Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Fafa-DL committed Apr 22, 2022
1 parent 4e7cb97 commit b4fff22
Show file tree
Hide file tree
Showing 70 changed files with 3,688 additions and 11 deletions.
Binary file modified configs/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/alexnet.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/convmixer.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/convnext.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/cspnet.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/efficientnet.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/hrnet.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/lenet.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/mobilenet_v2.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/mobilenet_v3.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/regnet.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/repvgg.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/res2net.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/resnet.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/resnext.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/seresnet.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/seresnext.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/shufflenet_v1.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/shufflenet_v2.cpython-36.pyc
Binary file not shown.
Binary file modified configs/backbones/__pycache__/vgg.cpython-36.pyc
Binary file not shown.
Binary file modified configs/basic/__pycache__/activations.cpython-36.pyc
Binary file not shown.
Binary file modified configs/basic/__pycache__/build_layer.cpython-36.pyc
Binary file not shown.
Binary file modified configs/basic/__pycache__/convolution.cpython-36.pyc
Binary file not shown.
Binary file modified configs/basic/__pycache__/normalization.cpython-36.pyc
Binary file not shown.
Binary file modified configs/basic/__pycache__/padding.cpython-36.pyc
Binary file not shown.
Binary file modified configs/common/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified configs/common/__pycache__/base_module.cpython-36.pyc
Binary file not shown.
Binary file modified configs/common/__pycache__/channel_shuffle.cpython-36.pyc
Binary file not shown.
Binary file modified configs/common/__pycache__/conv_module.cpython-36.pyc
Binary file not shown.
Binary file not shown.
Binary file modified configs/common/__pycache__/drop_path.cpython-36.pyc
Binary file not shown.
Binary file modified configs/common/__pycache__/helpers.cpython-36.pyc
Binary file not shown.
Binary file modified configs/common/__pycache__/inverted_residual.cpython-36.pyc
Binary file not shown.
Binary file modified configs/common/__pycache__/make_divisible.cpython-36.pyc
Binary file not shown.
Binary file modified configs/common/__pycache__/se_layer.cpython-36.pyc
Binary file not shown.
Binary file modified configs/heads/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified configs/heads/__pycache__/cls_head.cpython-36.pyc
Binary file not shown.
Binary file modified configs/heads/__pycache__/linear_head.cpython-36.pyc
Binary file not shown.
Binary file modified configs/heads/__pycache__/stacked_head.cpython-36.pyc
Binary file not shown.
Binary file modified configs/losses/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified configs/losses/__pycache__/cross_entropy_loss.cpython-36.pyc
Binary file not shown.
Binary file modified configs/losses/__pycache__/utils.cpython-36.pyc
Binary file not shown.
Binary file modified configs/necks/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified configs/necks/__pycache__/gap.cpython-36.pyc
Binary file not shown.
Binary file modified configs/necks/__pycache__/hr_fuse.cpython-36.pyc
Binary file not shown.
Binary file modified core/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified core/evaluations/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified core/evaluations/__pycache__/accuracy.cpython-36.pyc
Binary file not shown.
Binary file modified core/evaluations/__pycache__/eval_metrics.cpython-36.pyc
Binary file not shown.
Binary file modified core/initialize/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified core/initialize/__pycache__/weight_init.cpython-36.pyc
Binary file not shown.
Binary file modified core/optimizers/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified core/optimizers/__pycache__/lr_update.cpython-36.pyc
Binary file not shown.
5 changes: 5 additions & 0 deletions datas/annotations.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
daisy 0
dandelion 1
roses 2
sunflowers 3
tulips 4
Binary file added datas/mobilenet_v3_small-8427ecf0.pth
Binary file not shown.
731 changes: 731 additions & 0 deletions datas/test.txt

Large diffs are not rendered by default.

2,939 changes: 2,939 additions & 0 deletions datas/train.txt

Large diffs are not rendered by default.

Binary file added models/__pycache__/build.cpython-36.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified models/mobilenet/__pycache__/mobilenet_v3_small.cpython-36.pyc
Binary file not shown.
12 changes: 6 additions & 6 deletions models/mobilenet/mobilenet_v3_small.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
neck=dict(type='GlobalAveragePooling'),
head=dict(
type='StackedLinearClsHead',
num_classes=1000,
num_classes=5,
in_channels=576,
mid_channels=[1024],
dropout_rate=0.2,
Expand Down Expand Up @@ -33,17 +33,17 @@

# train
data_cfg = dict(
batch_size = 32,
num_workers = 4,
batch_size = 1,
num_workers = 2,
train = dict(
pretrained_flag = False,
pretrained_weights = 'datas/mobilenet_v3_small.pth',
pretrained_flag = True,
pretrained_weights = 'datas/mobilenet_v3_small-8427ecf0.pth',
freeze_flag = False,
freeze_layers = ('backbone',),
epoches = 100,
),
test=dict(
ckpt = 'logs/20220202091725/Val_Epoch019-Loss0.215.pth',
ckpt = 'logs/MobileNetV3/2022-04-10-09-17-25/Train_Epoch098-Loss0.035.pth',
metrics = ['accuracy', 'precision', 'recall', 'f1_score', 'confusion'],
metric_options = dict(
topk = (1,5),
Expand Down
3 changes: 2 additions & 1 deletion tools/evaluation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import sys
sys.path.insert(0,os.getcwd())
import argparse
import numpy as np
from numpy import mean
from tqdm import tqdm
Expand Down Expand Up @@ -39,7 +40,7 @@ def main():
"""
获取类别名以及对应索引、获取标注文件
"""
classes_map = 'datas/cls_classes.txt'
classes_map = 'datas/annotations.txt'
test_annotations = 'datas/test.txt'
classes_names, indexs = get_info(classes_map)
with open(test_annotations, encoding='utf-8') as f:
Expand Down
6 changes: 3 additions & 3 deletions tools/get_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ def main():

for dataset in datasets:
txt_file = open('datas/' + dataset + '.txt', 'w')
datasets_path = os.path.join(datasets_path, dataset)
classes_name = os.listdir(datasets_path)
datasets_path_ = os.path.join(datasets_path, dataset)
classes_name = os.listdir(datasets_path_)

for name in classes_name:
if name not in classes:
continue
cls_id = indexs[classes.index(name)]
images_path = os.path.join(datasets_path, name)
images_path = os.path.join(datasets_path_, name)
images_name = os.listdir(images_path)
for photo_name in images_name:
_, postfix = os.path.splitext(photo_name)
Expand Down
2 changes: 1 addition & 1 deletion tools/split_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def makedir(path):

split_rate = 0.2
init_dataset = ''
new_dataset = ''
new_dataset = 'datasets'
random.seed(0)

classes_name = [name for name in os.listdir(init_dataset)]
Expand Down
Binary file added utils/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file added utils/__pycache__/dataloader.cpython-36.pyc
Binary file not shown.
Binary file added utils/__pycache__/train_utils.cpython-36.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions utils/train_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def file2dict(filename):

abspath = os.path.abspath(os.path.expanduser(path))
sys.path.insert(0,abspath)
print(sys.path)
mod = importlib.import_module(file.split('.')[0])
sys.path.pop(0)
cfg_dict = {
Expand Down

0 comments on commit b4fff22

Please sign in to comment.