-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yolox improve with REPConv/ASFF/TOOD #154
Changes from 48 commits
1167efd
9988716
4f55bda
1f4b054
18db2c5
42472ff
a1e5bc1
d0c1297
19388ed
a88c747
a837d97
425d6c2
2e87257
7b08d4f
f0f7ffc
d9bb9af
5bc6e00
e812089
6a9241e
bc2b238
e9e0dfc
bb16a3f
bbdfb9f
2f5c6c4
71c6ea2
6fcb293
5ecb695
2346aaf
4066723
b1d7b6c
437342c
166fe9b
48975bb
58e3f0c
95028f4
33e0740
1d21505
ab87f09
ce4e7b5
502a9dc
6379b27
47f7e2e
81a2051
cac888a
8dbe360
feb0eeb
b8b2646
7e07113
e1e9e8a
2f7534f
a364d60
10f549e
1eb0a4b
08bbba8
a8ba8fd
7844e64
77973f1
67140ae
e8b6607
525f7c0
cfde0cd
4ffd599
600e2c2
68454fd
a6236d3
47c4581
eeb269a
53183ec
1fefb7e
93c0254
c22bf98
887e2be
b865306
b0fa9e6
a7a914c
3ff49fe
55c3c46
3490d45
991d2ce
99e0d4c
3eb7cd2
1b063fc
26b458f
e08509e
59a3916
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
_base_ = './yolox_s_8xb16_300e_coco.py' | ||
_base_ = 'configs/detection/yolox/yolox_s_8xb16_300e_coco.py' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. imitate configs/detection/fcos,reconstruct config There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
||
# model settings | ||
model = dict(model_type='l') | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
_base_ = '../../base.py' | ||
|
||
# model settings s m l x | ||
model = dict( | ||
type='YOLOX', | ||
test_conf=0.01, | ||
nms_thre=0.65, | ||
backbone=dict( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. register neck,backbone nested backbone is ugly There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, ckpt is also split into backbone and neck |
||
type='YOLOPAFPN', | ||
backbone='RepVGGYOLOX', | ||
model_type='s', # s m l x tiny nano | ||
use_att='ASFF', | ||
neck='yolo' | ||
), | ||
head=dict( | ||
type='TOODHead', | ||
model_type='s', | ||
obj_loss_type='BCE', | ||
reg_loss_type='giou', | ||
num_classes=80 | ||
) | ||
) | ||
|
||
# s m l x | ||
img_scale = (640, 640) | ||
random_size = (14, 26) | ||
scale_ratio = (0.1, 2) | ||
|
||
# tiny nano without mixup | ||
# img_scale = (416, 416) | ||
# random_size = (10, 20) | ||
# scale_ratio = (0.5, 1.5) | ||
|
||
CLASSES = [ | ||
'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', | ||
'truck', 'boat', 'traffic light', 'fire hydrant', 'stop sign', | ||
'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep', 'cow', | ||
'elephant', 'bear', 'zebra', 'giraffe', 'backpack', 'umbrella', 'handbag', | ||
'tie', 'suitcase', 'frisbee', 'skis', 'snowboard', 'sports ball', 'kite', | ||
'baseball bat', 'baseball glove', 'skateboard', 'surfboard', | ||
'tennis racket', 'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', | ||
'bowl', 'banana', 'apple', 'sandwich', 'orange', 'broccoli', 'carrot', | ||
'hot dog', 'pizza', 'donut', 'cake', 'chair', 'couch', 'potted plant', | ||
'bed', 'dining table', 'toilet', 'tv', 'laptop', 'mouse', 'remote', | ||
'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink', | ||
'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear', | ||
'hair drier', 'toothbrush' | ||
] | ||
|
||
# dataset settings | ||
# data_root = '/apsarapangu/disk2/xinyi.zxy/data/coco/' | ||
# data_root = '/mnt/data/nas/data/detection/coco/' | ||
data_root = '/root/workspace/data/coco/' | ||
|
||
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='MMMosaic', img_scale=img_scale, pad_val=114.0), | ||
dict( | ||
type='MMRandomAffine', | ||
scaling_ratio_range=scale_ratio, | ||
border=(-img_scale[0] // 2, -img_scale[1] // 2)), | ||
dict( | ||
type='MMMixUp', # s m x l; tiny nano will detele | ||
img_scale=img_scale, | ||
ratio_range=(0.8, 1.6), | ||
pad_val=114.0), | ||
dict( | ||
type='MMPhotoMetricDistortion', | ||
brightness_delta=32, | ||
contrast_range=(0.5, 1.5), | ||
saturation_range=(0.5, 1.5), | ||
hue_delta=18), | ||
dict(type='MMRandomFlip', flip_ratio=0.5), | ||
dict(type='MMResize', keep_ratio=True), | ||
dict(type='MMPad', pad_to_square=True, pad_val=(114.0, 114.0, 114.0)), | ||
dict(type='MMNormalize', **img_norm_cfg), | ||
dict(type='DefaultFormatBundle'), | ||
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']) | ||
] | ||
test_pipeline = [ | ||
dict(type='MMResize', img_scale=img_scale, keep_ratio=True), | ||
dict(type='MMPad', pad_to_square=True, pad_val=(114.0, 114.0, 114.0)), | ||
dict(type='MMNormalize', **img_norm_cfg), | ||
dict(type='DefaultFormatBundle'), | ||
dict(type='Collect', keys=['img']) | ||
] | ||
|
||
train_dataset = dict( | ||
type='DetImagesMixDataset', | ||
data_source=dict( | ||
type='DetSourceCoco', | ||
ann_file=data_root + 'annotations/instances_train2017.json', | ||
img_prefix=data_root + 'train2017/', | ||
pipeline=[ | ||
dict(type='LoadImageFromFile', to_float32=True), | ||
dict(type='LoadAnnotations', with_bbox=True) | ||
], | ||
classes=CLASSES, | ||
filter_empty_gt=False, | ||
iscrowd=False), | ||
pipeline=train_pipeline, | ||
dynamic_scale=img_scale) | ||
|
||
val_dataset = dict( | ||
type='DetImagesMixDataset', | ||
imgs_per_gpu=2, | ||
data_source=dict( | ||
type='DetSourceCoco', | ||
ann_file=data_root + 'annotations/instances_val2017.json', | ||
img_prefix=data_root + 'val2017/', | ||
pipeline=[ | ||
dict(type='LoadImageFromFile', to_float32=True), | ||
dict(type='LoadAnnotations', with_bbox=True) | ||
], | ||
classes=CLASSES, | ||
filter_empty_gt=False, | ||
iscrowd=True), | ||
pipeline=test_pipeline, | ||
dynamic_scale=None, | ||
label_padding=False) | ||
|
||
data = dict( | ||
imgs_per_gpu=16, workers_per_gpu=4, train=train_dataset, val=val_dataset) | ||
|
||
# additional hooks | ||
interval = 10 | ||
custom_hooks = [ | ||
dict( | ||
type='YOLOXModeSwitchHook', | ||
no_aug_epochs=15, | ||
skip_type_keys=('MMMosaic', 'MMRandomAffine', 'MMMixUp'), | ||
priority=48), | ||
dict( | ||
type='SyncRandomSizeHook', | ||
ratio_range=random_size, | ||
img_scale=img_scale, | ||
interval=interval, | ||
priority=48), | ||
dict( | ||
type='SyncNormHook', | ||
num_last_epochs=15, | ||
interval=interval, | ||
priority=48) | ||
] | ||
|
||
# evaluation | ||
eval_config = dict( | ||
interval=10, | ||
gpu_collect=False, | ||
visualization_config=dict( | ||
vis_num=10, | ||
score_thr=0.5, | ||
) # show by TensorboardLoggerHookV2 and WandbLoggerHookV2 | ||
) | ||
eval_pipelines = [ | ||
dict( | ||
mode='test', | ||
data=data['val'], | ||
evaluators=[dict(type='CocoDetectionEvaluator', classes=CLASSES)], | ||
) | ||
] | ||
|
||
checkpoint_config = dict(interval=interval) | ||
|
||
# optimizer | ||
optimizer = dict( | ||
type='SGD', lr=0.02, momentum=0.9, weight_decay=5e-4, nesterov=True) | ||
optimizer_config = {} | ||
|
||
# learning policy | ||
lr_config = dict( | ||
policy='YOLOX', | ||
warmup='exp', | ||
by_epoch=False, | ||
warmup_by_epoch=True, | ||
warmup_ratio=1, | ||
warmup_iters=5, # 5 epoch | ||
num_last_epochs=15, | ||
min_lr_ratio=0.05) | ||
|
||
# exponetial model average | ||
ema = dict(decay=0.9998) | ||
|
||
# runtime settings | ||
total_epochs = 300 | ||
|
||
# yapf:disable | ||
log_config = dict( | ||
interval=100, | ||
hooks=[ | ||
dict(type='TextLoggerHook'), | ||
dict(type='TensorboardLoggerHookV2'), | ||
# dict(type='WandbLoggerHookV2'), | ||
]) | ||
|
||
export = dict(use_jit=False, export_blade=False, end2end=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why modify base path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change as the base path done