mmaction2
/
projects
/gesture_recognition
/configs
/rtmdet-nano_8xb32-300e_multi-dataset-hand-320x320.py
_base_ = 'mmdet::rtmdet/rtmdet_nano_8xb32-300e_coco.py' | |
input_shape = 320 | |
model = dict( | |
backbone=dict( | |
deepen_factor=0.33, | |
widen_factor=0.25, | |
use_depthwise=True, | |
), | |
neck=dict( | |
in_channels=[64, 128, 256], | |
out_channels=64, | |
num_csp_blocks=1, | |
use_depthwise=True, | |
), | |
bbox_head=dict( | |
in_channels=64, | |
feat_channels=64, | |
share_conv=False, | |
exp_on_reg=False, | |
use_depthwise=True, | |
num_classes=1), | |
test_cfg=dict( | |
nms_pre=1000, | |
min_bbox_size=0, | |
score_thr=0.05, | |
nms=dict(type='nms', iou_threshold=0.6), | |
max_per_img=100)) | |
data_root = 'data/' | |
file_client_args = dict(backend='disk') | |
train_pipeline = [ | |
dict(type='LoadImageFromFile', file_client_args=file_client_args), | |
dict(type='LoadAnnotations', with_bbox=True), | |
dict( | |
type='CachedMosaic', | |
img_scale=(input_shape, input_shape), | |
pad_val=114.0, | |
max_cached_images=20, | |
random_pop=False), | |
dict( | |
type='RandomResize', | |
scale=(input_shape * 2, input_shape * 2), | |
ratio_range=(0.5, 1.5), | |
keep_ratio=True), | |
dict(type='RandomCrop', crop_size=(input_shape, input_shape)), | |
dict(type='YOLOXHSVRandomAug'), | |
dict(type='RandomFlip', prob=0.5), | |
dict( | |
type='Pad', | |
size=(input_shape, input_shape), | |
pad_val=dict(img=(114, 114, 114))), | |
dict(type='PackDetInputs') | |
] | |
train_pipeline_stage2 = [ | |
dict(type='LoadImageFromFile', file_client_args=file_client_args), | |
dict(type='LoadAnnotations', with_bbox=True), | |
dict( | |
type='RandomResize', | |
scale=(input_shape, input_shape), | |
ratio_range=(0.5, 1.5), | |
keep_ratio=True), | |
dict(type='RandomCrop', crop_size=(input_shape, input_shape)), | |
dict(type='YOLOXHSVRandomAug'), | |
dict(type='RandomFlip', prob=0.5), | |
dict( | |
type='Pad', | |
size=(input_shape, input_shape), | |
pad_val=dict(img=(114, 114, 114))), | |
dict(type='PackDetInputs') | |
] | |
test_pipeline = [ | |
dict(type='LoadImageFromFile', file_client_args=file_client_args), | |
dict(type='Resize', scale=(input_shape, input_shape), keep_ratio=True), | |
dict( | |
type='Pad', | |
size=(input_shape, input_shape), | |
pad_val=dict(img=(114, 114, 114))), | |
dict( | |
type='PackDetInputs', | |
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', | |
'scale_factor')) | |
] | |
train_dataloader = dict( | |
dataset=dict( | |
data_root=data_root, | |
ann_file='hand_det/hand_det_train.json', | |
data_prefix=dict(img=''), | |
pipeline=train_pipeline, | |
metainfo=dict(classes=('hand', )), | |
)) | |
val_dataloader = dict( | |
dataset=dict( | |
data_root=data_root, | |
ann_file='hand_det/hand_det_val.json', | |
data_prefix=dict(img=''), | |
pipeline=test_pipeline, | |
metainfo=dict(classes=('hand', )), | |
)) | |
test_dataloader = val_dataloader | |
val_evaluator = dict(ann_file=data_root + 'hand_det/hand_det_val.json') | |
test_evaluator = val_evaluator | |
custom_hooks = [ | |
dict( | |
type='EMAHook', | |
ema_type='ExpMomentumEMA', | |
momentum=0.0002, | |
update_buffers=True, | |
priority=49), | |
dict( | |
type='PipelineSwitchHook', | |
switch_epoch=280, | |
switch_pipeline=train_pipeline_stage2) | |
] | |