-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/dev'
- Loading branch information
Showing
139 changed files
with
8,410 additions
and
2,012 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
_base_ = ['./pipelines/rand_aug.py'] | ||
|
||
# dataset settings | ||
dataset_type = 'ImageNet' | ||
img_norm_cfg = dict( | ||
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) | ||
|
||
train_pipeline = [ | ||
dict(type='LoadImageFromFile'), | ||
dict( | ||
type='RandomResizedCrop', | ||
size=256, | ||
backend='pillow', | ||
interpolation='bicubic'), | ||
dict(type='RandomFlip', flip_prob=0.5, direction='horizontal'), | ||
dict( | ||
type='RandAugment', | ||
policies={{_base_.rand_increasing_policies}}, | ||
num_policies=2, | ||
total_level=10, | ||
magnitude_level=9, | ||
magnitude_std=0.5, | ||
hparams=dict( | ||
pad_val=[round(x) for x in img_norm_cfg['mean'][::-1]], | ||
interpolation='bicubic')), | ||
dict( | ||
type='RandomErasing', | ||
erase_prob=0.25, | ||
mode='rand', | ||
min_area_ratio=0.02, | ||
max_area_ratio=1 / 3, | ||
fill_color=img_norm_cfg['mean'][::-1], | ||
fill_std=img_norm_cfg['std'][::-1]), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='ImageToTensor', keys=['img']), | ||
dict(type='ToTensor', keys=['gt_label']), | ||
dict(type='Collect', keys=['img', 'gt_label']) | ||
] | ||
|
||
test_pipeline = [ | ||
dict(type='LoadImageFromFile'), | ||
dict( | ||
type='Resize', | ||
size=(292, -1), # ( 256 / 224 * 256 ) | ||
backend='pillow', | ||
interpolation='bicubic'), | ||
dict(type='CenterCrop', crop_size=256), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='ImageToTensor', keys=['img']), | ||
dict(type='Collect', keys=['img']) | ||
] | ||
data = dict( | ||
samples_per_gpu=64, | ||
workers_per_gpu=8, | ||
train=dict( | ||
type=dataset_type, | ||
data_prefix='data/imagenet/train', | ||
pipeline=train_pipeline), | ||
val=dict( | ||
type=dataset_type, | ||
data_prefix='data/imagenet/val', | ||
ann_file='data/imagenet/meta/val.txt', | ||
pipeline=test_pipeline), | ||
test=dict( | ||
# replace `data/val` with `data/test` for standard test | ||
type=dataset_type, | ||
data_prefix='data/imagenet/val', | ||
ann_file='data/imagenet/meta/val.txt', | ||
pipeline=test_pipeline)) | ||
|
||
evaluation = dict(interval=10, metric='accuracy') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# dataset settings | ||
dataset_type = 'StanfordCars' | ||
img_norm_cfg = dict( | ||
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) | ||
train_pipeline = [ | ||
dict(type='LoadImageFromFile'), | ||
dict(type='Resize', size=512), | ||
dict(type='RandomCrop', size=448), | ||
dict(type='RandomFlip', flip_prob=0.5, direction='horizontal'), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='ImageToTensor', keys=['img']), | ||
dict(type='ToTensor', keys=['gt_label']), | ||
dict(type='Collect', keys=['img', 'gt_label']) | ||
] | ||
test_pipeline = [ | ||
dict(type='LoadImageFromFile'), | ||
dict(type='Resize', size=512), | ||
dict(type='CenterCrop', crop_size=448), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='ImageToTensor', keys=['img']), | ||
dict(type='Collect', keys=['img']) | ||
] | ||
|
||
data_root = 'data/stanfordcars' | ||
data = dict( | ||
samples_per_gpu=8, | ||
workers_per_gpu=2, | ||
train=dict( | ||
type=dataset_type, | ||
data_prefix=data_root, | ||
test_mode=False, | ||
pipeline=train_pipeline), | ||
val=dict( | ||
type=dataset_type, | ||
data_prefix=data_root, | ||
test_mode=True, | ||
pipeline=test_pipeline), | ||
test=dict( | ||
type=dataset_type, | ||
data_prefix=data_root, | ||
test_mode=True, | ||
pipeline=test_pipeline)) | ||
|
||
evaluation = dict( | ||
interval=1, metric='accuracy', | ||
save_best='auto') # save the checkpoint with highest accuracy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# model settings | ||
model = dict( | ||
type='ImageClassifier', | ||
backbone=dict(type='HorNet', arch='base-gf', drop_path_rate=0.5), | ||
head=dict( | ||
type='LinearClsHead', | ||
num_classes=1000, | ||
in_channels=1024, | ||
init_cfg=None, # suppress the default init_cfg of LinearClsHead. | ||
loss=dict( | ||
type='LabelSmoothLoss', label_smooth_val=0.1, mode='original'), | ||
cal_acc=False), | ||
init_cfg=[ | ||
dict(type='TruncNormal', layer='Linear', std=0.02, bias=0.), | ||
dict(type='Constant', layer='LayerNorm', val=1., bias=0.), | ||
dict(type='Constant', layer=['LayerScale'], val=1e-6) | ||
], | ||
train_cfg=dict(augments=[ | ||
dict(type='BatchMixup', alpha=0.8, num_classes=1000, prob=0.5), | ||
dict(type='BatchCutMix', alpha=1.0, num_classes=1000, prob=0.5) | ||
])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# model settings | ||
model = dict( | ||
type='ImageClassifier', | ||
backbone=dict(type='HorNet', arch='base', drop_path_rate=0.5), | ||
head=dict( | ||
type='LinearClsHead', | ||
num_classes=1000, | ||
in_channels=1024, | ||
init_cfg=None, # suppress the default init_cfg of LinearClsHead. | ||
loss=dict( | ||
type='LabelSmoothLoss', label_smooth_val=0.1, mode='original'), | ||
cal_acc=False), | ||
init_cfg=[ | ||
dict(type='TruncNormal', layer='Linear', std=0.02, bias=0.), | ||
dict(type='Constant', layer='LayerNorm', val=1., bias=0.), | ||
dict(type='Constant', layer=['LayerScale'], val=1e-6) | ||
], | ||
train_cfg=dict(augments=[ | ||
dict(type='BatchMixup', alpha=0.8, num_classes=1000, prob=0.5), | ||
dict(type='BatchCutMix', alpha=1.0, num_classes=1000, prob=0.5) | ||
])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# model settings | ||
model = dict( | ||
type='ImageClassifier', | ||
backbone=dict(type='HorNet', arch='large-gf', drop_path_rate=0.2), | ||
head=dict( | ||
type='LinearClsHead', | ||
num_classes=1000, | ||
in_channels=1536, | ||
init_cfg=None, # suppress the default init_cfg of LinearClsHead. | ||
loss=dict( | ||
type='LabelSmoothLoss', label_smooth_val=0.1, mode='original'), | ||
cal_acc=False), | ||
init_cfg=[ | ||
dict(type='TruncNormal', layer='Linear', std=0.02, bias=0.), | ||
dict(type='Constant', layer='LayerNorm', val=1., bias=0.), | ||
dict(type='Constant', layer=['LayerScale'], val=1e-6) | ||
], | ||
train_cfg=dict(augments=[ | ||
dict(type='BatchMixup', alpha=0.8, num_classes=1000, prob=0.5), | ||
dict(type='BatchCutMix', alpha=1.0, num_classes=1000, prob=0.5) | ||
])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# model settings | ||
model = dict( | ||
type='ImageClassifier', | ||
backbone=dict(type='HorNet', arch='large-gf384', drop_path_rate=0.4), | ||
head=dict( | ||
type='LinearClsHead', | ||
num_classes=1000, | ||
in_channels=1536, | ||
init_cfg=None, # suppress the default init_cfg of LinearClsHead. | ||
loss=dict( | ||
type='LabelSmoothLoss', label_smooth_val=0.1, mode='original'), | ||
cal_acc=False), | ||
init_cfg=[ | ||
dict(type='TruncNormal', layer='Linear', std=0.02, bias=0.), | ||
dict(type='Constant', layer='LayerNorm', val=1., bias=0.), | ||
dict(type='Constant', layer=['LayerScale'], val=1e-6) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# model settings | ||
model = dict( | ||
type='ImageClassifier', | ||
backbone=dict(type='HorNet', arch='large', drop_path_rate=0.2), | ||
head=dict( | ||
type='LinearClsHead', | ||
num_classes=1000, | ||
in_channels=1536, | ||
init_cfg=None, # suppress the default init_cfg of LinearClsHead. | ||
loss=dict( | ||
type='LabelSmoothLoss', label_smooth_val=0.1, mode='original'), | ||
cal_acc=False), | ||
init_cfg=[ | ||
dict(type='TruncNormal', layer='Linear', std=0.02, bias=0.), | ||
dict(type='Constant', layer='LayerNorm', val=1., bias=0.), | ||
dict(type='Constant', layer=['LayerScale'], val=1e-6) | ||
], | ||
train_cfg=dict(augments=[ | ||
dict(type='BatchMixup', alpha=0.8, num_classes=1000, prob=0.5), | ||
dict(type='BatchCutMix', alpha=1.0, num_classes=1000, prob=0.5) | ||
])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# model settings | ||
model = dict( | ||
type='ImageClassifier', | ||
backbone=dict(type='HorNet', arch='small-gf', drop_path_rate=0.4), | ||
head=dict( | ||
type='LinearClsHead', | ||
num_classes=1000, | ||
in_channels=768, | ||
init_cfg=None, # suppress the default init_cfg of LinearClsHead. | ||
loss=dict( | ||
type='LabelSmoothLoss', label_smooth_val=0.1, mode='original'), | ||
cal_acc=False), | ||
init_cfg=[ | ||
dict(type='TruncNormal', layer='Linear', std=0.02, bias=0.), | ||
dict(type='Constant', layer='LayerNorm', val=1., bias=0.), | ||
dict(type='Constant', layer=['LayerScale'], val=1e-6) | ||
], | ||
train_cfg=dict(augments=[ | ||
dict(type='BatchMixup', alpha=0.8, num_classes=1000, prob=0.5), | ||
dict(type='BatchCutMix', alpha=1.0, num_classes=1000, prob=0.5) | ||
])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# model settings | ||
model = dict( | ||
type='ImageClassifier', | ||
backbone=dict(type='HorNet', arch='small', drop_path_rate=0.4), | ||
head=dict( | ||
type='LinearClsHead', | ||
num_classes=1000, | ||
in_channels=768, | ||
init_cfg=None, # suppress the default init_cfg of LinearClsHead. | ||
loss=dict( | ||
type='LabelSmoothLoss', label_smooth_val=0.1, mode='original'), | ||
cal_acc=False), | ||
init_cfg=[ | ||
dict(type='TruncNormal', layer='Linear', std=0.02, bias=0.), | ||
dict(type='Constant', layer='LayerNorm', val=1., bias=0.), | ||
dict(type='Constant', layer=['LayerScale'], val=1e-6) | ||
], | ||
train_cfg=dict(augments=[ | ||
dict(type='BatchMixup', alpha=0.8, num_classes=1000, prob=0.5), | ||
dict(type='BatchCutMix', alpha=1.0, num_classes=1000, prob=0.5) | ||
])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# model settings | ||
model = dict( | ||
type='ImageClassifier', | ||
backbone=dict(type='HorNet', arch='tiny-gf', drop_path_rate=0.2), | ||
head=dict( | ||
type='LinearClsHead', | ||
num_classes=1000, | ||
in_channels=512, | ||
init_cfg=None, # suppress the default init_cfg of LinearClsHead. | ||
loss=dict( | ||
type='LabelSmoothLoss', label_smooth_val=0.1, mode='original'), | ||
cal_acc=False), | ||
init_cfg=[ | ||
dict(type='TruncNormal', layer='Linear', std=0.02, bias=0.), | ||
dict(type='Constant', layer='LayerNorm', val=1., bias=0.), | ||
dict(type='Constant', layer=['LayerScale'], val=1e-6) | ||
], | ||
train_cfg=dict(augments=[ | ||
dict(type='BatchMixup', alpha=0.8, num_classes=1000, prob=0.5), | ||
dict(type='BatchCutMix', alpha=1.0, num_classes=1000, prob=0.5) | ||
])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# model settings | ||
model = dict( | ||
type='ImageClassifier', | ||
backbone=dict(type='HorNet', arch='tiny', drop_path_rate=0.2), | ||
head=dict( | ||
type='LinearClsHead', | ||
num_classes=1000, | ||
in_channels=512, | ||
init_cfg=None, # suppress the default init_cfg of LinearClsHead. | ||
loss=dict( | ||
type='LabelSmoothLoss', label_smooth_val=0.1, mode='original'), | ||
cal_acc=False), | ||
init_cfg=[ | ||
dict(type='TruncNormal', layer='Linear', std=0.02, bias=0.), | ||
dict(type='Constant', layer='LayerNorm', val=1., bias=0.), | ||
dict(type='Constant', layer=['LayerScale'], val=1e-6) | ||
], | ||
train_cfg=dict(augments=[ | ||
dict(type='BatchMixup', alpha=0.8, num_classes=1000, prob=0.5), | ||
dict(type='BatchCutMix', alpha=1.0, num_classes=1000, prob=0.5) | ||
])) |
Oops, something went wrong.