MMPOSE
MMPOSE是一個基于PyTorch實(shí)現(xiàn)的目標(biāo)姿態(tài)估計(jì)框架,configs文件主要是用于配置訓(xùn)練和測試的參數(shù),包括網(wǎng)絡(luò)架構(gòu)、數(shù)據(jù)集路徑、學(xué)習(xí)率、批量大小等等。下面簡單介紹一下MMPOSE的configs文件。
MMPOSE的configs文件通常由兩個主要部分組成:default和具體任務(wù)的配置。default是基礎(chǔ)配置,包含了各種共享的參數(shù),如數(shù)據(jù)集、模型架構(gòu)、訓(xùn)練優(yōu)化器、調(diào)試模式等。而任務(wù)特定的配置則包含了特定任務(wù)的參數(shù),如數(shù)據(jù)增強(qiáng)方式、訓(xùn)練數(shù)據(jù)集路徑、評估方式等。
# fp16 settingsfp16 = Noneoptimizer_config = dict(type='adam', lr=0.001)
optimizer = dict(type='Adam', lr=0.001, weight_decay=0.0001)
lr_config = dict(policy='step', step=[6, 8])
total_epochs = 10# data settingsdata_root = 'data/coco/'data = dict(
? ?samples_per_gpu=4,
? ?workers_per_gpu=4,
? ?train=dict( ? ? ? ?type='TopDownCocoDataset',
? ? ? ?ann_file=data_root + 'annotations/person_keypoints_train2017.json',
? ? ? ?img_prefix=data_root + 'train2017/',
? ? ? ?data_cfg=dict(
? ? ? ? ? ?num_joints=17,
? ? ? ? ? ?heatmap_size=[64, 64],
? ? ? ? ? ?num_output_channels=17,
? ? ? ? ? ?joint_names=[ ? ? ? ? ? ? ? ?'nose', 'left_eye', 'right_eye', 'left_ear', 'right_ear', ? ? ? ? ? ? ? ?'left_shoulder', 'right_shoulder', 'left_elbow', 'right_elbow', ? ? ? ? ? ? ? ?'left_wrist', 'right_wrist', 'left_hip', 'right_hip', ? ? ? ? ? ? ? ?'left_knee', 'right_knee', 'left_ankle', 'right_ankle'
? ? ? ? ? ?],
? ? ? ? ? ?coco_dir=data_root),
? ? ? ?pipeline=[ ? ? ? ? ? ?dict(type='LoadImageFromFile'), ? ? ? ? ? ?dict(type='TopDownRandomFlip', flip_prob=0.5), ? ? ? ? ? ?dict( ? ? ? ? ? ? ? ?type='TopDownRandomAffine',
? ? ? ? ? ? ? ?scale_range=[0.7, 1.3],
? ? ? ? ? ? ? ?rot_range=[-40, 40],
? ? ? ? ? ? ? ?shear_range=[-40, 40]), ? ? ? ? ? ?dict( ? ? ? ? ? ? ? ?type='TopDownGetRandomColor',
? ? ? ? ? ? ? ?color_jitter=dict(
? ? ? ? ? ? ? ? ? ?brightness=0.3,
? ? ? ? ? ? ? ? ? ?contrast=0.3,
? ? ? ? ? ? ? ? ? ?saturation=0.3,
? ? ? ? ? ? ? ? ? ?hue=0.1)), ? ? ? ? ? ?dict( ? ? ? ? ? ? ? ?type='TopDownGenerateTarget', sigma=2), ? ? ? ? ? ?dict( ? ? ? ? ? ? ? ?type='Collect',
? ? ? ? ? ? ? ?keys=['img', 'target', 'target_weight'],
? ? ? ? ? ? ? ?meta_keys=[ ? ? ? ? ? ? ? ? ? ?'image_file', 'joints_3d', 'joints_3d_visibility', 'center', 'scale', ? ? ? ? ? ? ? ? ? ?'rotation', 'flip_pairs', 'flip_index']), ? ? ? ? ? ?dict(type='ToTensor', keys=['img', 'target', 'target_weight'])
? ? ? ?]),
? ?val=dict( ? ? ? ?type='TopDownCocoDataset',
? ? ? ?ann_file=data_root + 'annotations/person_keypoints_val2017.json',
? ? ? ?img_prefix=data_root + 'val2017/',
? ? ? ?data_cfg=dict(
? ? ? ? ? ?num_joints=17,
? ? ? ? ? ?heatmap_size=[64, 64],
? ? ? ? ? ?num_output_channels=17,
? ? ? ? ? ?joint_names=[ ? ? ? ? ? ? ? ?'nose', 'left_eye', 'right_eye',