primateface-models / pose /vitpose_base_68kpt_config.py
fparodi's picture
Upload pose/vitpose_base_68kpt_config.py with huggingface_hub
4fade59 verified
default_scope = 'mmpose'
default_hooks = dict(
timer=dict(type='IterTimerHook'),
logger=dict(type='LoggerHook', interval=50),
param_scheduler=dict(type='ParamSchedulerHook'),
checkpoint=dict(
type='CheckpointHook',
interval=10,
save_best='NME',
rule='less',
max_keep_ckpts=2),
sampler_seed=dict(type='DistSamplerSeedHook'),
visualization=dict(type='PoseVisualizationHook', enable=False))
custom_hooks = [dict(type='SyncBuffersHook')]
env_cfg = dict(
cudnn_benchmark=False,
mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
dist_cfg=dict(backend='nccl'))
vis_backends = [dict(type='LocalVisBackend')]
visualizer = dict(
type='PoseLocalVisualizer',
vis_backends=[dict(type='LocalVisBackend')],
name='visualizer')
log_processor = dict(
type='LogProcessor', window_size=50, by_epoch=True, num_digits=6)
log_level = 'INFO'
# load_from = 'Y:\\MacFace\\results\\coco_whface\\best_NME_epoch_20.pth'
resume = False
backend_args = dict(backend='local')
train_cfg = dict(by_epoch=True, max_epochs=210, val_interval=1)
val_cfg = dict()
test_cfg = dict()
dataset_info = dict(
dataset_name='coco_wholebody_face',
paper_info=dict(
author=
'Jin, Sheng and Xu, Lumin and Xu, Jin and Wang, Can and Liu, Wentao and Qian, Chen and Ouyang, Wanli and Luo, Ping',
title='Whole-Body Human Pose Estimation in the Wild',
container=
'Proceedings of the European Conference on Computer Vision (ECCV)',
year='2020',
homepage='https://github.com/jin-s13/COCO-WholeBody/'),
keypoint_info=dict({
0:
dict(name='face-0', id=0, color=[255, 0, 0], type='', swap='face-16'),
1:
dict(name='face-1', id=1, color=[255, 0, 0], type='', swap='face-15'),
2:
dict(name='face-2', id=2, color=[255, 0, 0], type='', swap='face-14'),
3:
dict(name='face-3', id=3, color=[255, 0, 0], type='', swap='face-13'),
4:
dict(name='face-4', id=4, color=[255, 0, 0], type='', swap='face-12'),
5:
dict(name='face-5', id=5, color=[255, 0, 0], type='', swap='face-11'),
6:
dict(name='face-6', id=6, color=[255, 0, 0], type='', swap='face-10'),
7:
dict(name='face-7', id=7, color=[255, 0, 0], type='', swap='face-9'),
8:
dict(name='face-8', id=8, color=[255, 0, 0], type='', swap=''),
9:
dict(name='face-9', id=9, color=[255, 0, 0], type='', swap='face-7'),
10:
dict(name='face-10', id=10, color=[255, 0, 0], type='', swap='face-6'),
11:
dict(name='face-11', id=11, color=[255, 0, 0], type='', swap='face-5'),
12:
dict(name='face-12', id=12, color=[255, 0, 0], type='', swap='face-4'),
13:
dict(name='face-13', id=13, color=[255, 0, 0], type='', swap='face-3'),
14:
dict(name='face-14', id=14, color=[255, 0, 0], type='', swap='face-2'),
15:
dict(name='face-15', id=15, color=[255, 0, 0], type='', swap='face-1'),
16:
dict(name='face-16', id=16, color=[255, 0, 0], type='', swap='face-0'),
17:
dict(
name='face-17', id=17, color=[255, 0, 0], type='', swap='face-26'),
18:
dict(
name='face-18', id=18, color=[255, 0, 0], type='', swap='face-25'),
19:
dict(
name='face-19', id=19, color=[255, 0, 0], type='', swap='face-24'),
20:
dict(
name='face-20', id=20, color=[255, 0, 0], type='', swap='face-23'),
21:
dict(
name='face-21', id=21, color=[255, 0, 0], type='', swap='face-22'),
22:
dict(
name='face-22', id=22, color=[255, 0, 0], type='', swap='face-21'),
23:
dict(
name='face-23', id=23, color=[255, 0, 0], type='', swap='face-20'),
24:
dict(
name='face-24', id=24, color=[255, 0, 0], type='', swap='face-19'),
25:
dict(
name='face-25', id=25, color=[255, 0, 0], type='', swap='face-18'),
26:
dict(
name='face-26', id=26, color=[255, 0, 0], type='', swap='face-17'),
27:
dict(name='face-27', id=27, color=[255, 0, 0], type='', swap=''),
28:
dict(name='face-28', id=28, color=[255, 0, 0], type='', swap=''),
29:
dict(name='face-29', id=29, color=[255, 0, 0], type='', swap=''),
30:
dict(name='face-30', id=30, color=[255, 0, 0], type='', swap=''),
31:
dict(
name='face-31', id=31, color=[255, 0, 0], type='', swap='face-35'),
32:
dict(
name='face-32', id=32, color=[255, 0, 0], type='', swap='face-34'),
33:
dict(name='face-33', id=33, color=[255, 0, 0], type='', swap=''),
34:
dict(
name='face-34', id=34, color=[255, 0, 0], type='', swap='face-32'),
35:
dict(
name='face-35', id=35, color=[255, 0, 0], type='', swap='face-31'),
36:
dict(
name='face-36', id=36, color=[255, 0, 0], type='', swap='face-45'),
37:
dict(
name='face-37', id=37, color=[255, 0, 0], type='', swap='face-44'),
38:
dict(
name='face-38', id=38, color=[255, 0, 0], type='', swap='face-43'),
39:
dict(
name='face-39', id=39, color=[255, 0, 0], type='', swap='face-42'),
40:
dict(
name='face-40', id=40, color=[255, 0, 0], type='', swap='face-47'),
41:
dict(
name='face-41', id=41, color=[255, 0, 0], type='', swap='face-46'),
42:
dict(
name='face-42', id=42, color=[255, 0, 0], type='', swap='face-39'),
43:
dict(
name='face-43', id=43, color=[255, 0, 0], type='', swap='face-38'),
44:
dict(
name='face-44', id=44, color=[255, 0, 0], type='', swap='face-37'),
45:
dict(
name='face-45', id=45, color=[255, 0, 0], type='', swap='face-36'),
46:
dict(
name='face-46', id=46, color=[255, 0, 0], type='', swap='face-41'),
47:
dict(
name='face-47', id=47, color=[255, 0, 0], type='', swap='face-40'),
48:
dict(
name='face-48', id=48, color=[255, 0, 0], type='', swap='face-54'),
49:
dict(
name='face-49', id=49, color=[255, 0, 0], type='', swap='face-53'),
50:
dict(
name='face-50', id=50, color=[255, 0, 0], type='', swap='face-52'),
51:
dict(name='face-51', id=52, color=[255, 0, 0], type='', swap=''),
52:
dict(
name='face-52', id=52, color=[255, 0, 0], type='', swap='face-50'),
53:
dict(
name='face-53', id=53, color=[255, 0, 0], type='', swap='face-49'),
54:
dict(
name='face-54', id=54, color=[255, 0, 0], type='', swap='face-48'),
55:
dict(
name='face-55', id=55, color=[255, 0, 0], type='', swap='face-59'),
56:
dict(
name='face-56', id=56, color=[255, 0, 0], type='', swap='face-58'),
57:
dict(name='face-57', id=57, color=[255, 0, 0], type='', swap=''),
58:
dict(
name='face-58', id=58, color=[255, 0, 0], type='', swap='face-56'),
59:
dict(
name='face-59', id=59, color=[255, 0, 0], type='', swap='face-55'),
60:
dict(
name='face-60', id=60, color=[255, 0, 0], type='', swap='face-64'),
61:
dict(
name='face-61', id=61, color=[255, 0, 0], type='', swap='face-63'),
62:
dict(name='face-62', id=62, color=[255, 0, 0], type='', swap=''),
63:
dict(
name='face-63', id=63, color=[255, 0, 0], type='', swap='face-61'),
64:
dict(
name='face-64', id=64, color=[255, 0, 0], type='', swap='face-60'),
65:
dict(
name='face-65', id=65, color=[255, 0, 0], type='', swap='face-67'),
66:
dict(name='face-66', id=66, color=[255, 0, 0], type='', swap=''),
67:
dict(
name='face-67', id=67, color=[255, 0, 0], type='', swap='face-65')
}),
skeleton_info=dict(),
joint_weights=[
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0
],
sigmas=[
0.042, 0.043, 0.044, 0.043, 0.04, 0.035, 0.031, 0.025, 0.02, 0.023,
0.029, 0.032, 0.037, 0.038, 0.043, 0.041, 0.045, 0.013, 0.012, 0.011,
0.011, 0.012, 0.012, 0.011, 0.011, 0.013, 0.015, 0.009, 0.007, 0.007,
0.007, 0.012, 0.009, 0.008, 0.016, 0.01, 0.017, 0.011, 0.009, 0.011,
0.009, 0.007, 0.013, 0.008, 0.011, 0.012, 0.01, 0.034, 0.008, 0.008,
0.009, 0.008, 0.008, 0.007, 0.01, 0.008, 0.009, 0.009, 0.009, 0.007,
0.007, 0.008, 0.011, 0.008, 0.008, 0.008, 0.01, 0.008
])
custom_imports = dict(
imports=['mmpose.engine.optim_wrappers.layer_decay_optim_wrapper'],
allow_failed_imports=False)
optim_wrapper = dict(
optimizer=dict(
type='AdamW', lr=1e-05, betas=(0.9, 0.999), weight_decay=0.1),
paramwise_cfg=dict(
num_layers=24,
layer_decay_rate=0.8,
custom_keys=dict(
bias=dict(decay_multi=0.0),
pos_embed=dict(decay_mult=0.0),
relative_position_bias_table=dict(decay_mult=0.0),
norm=dict(decay_mult=0.0))),
constructor='LayerDecayOptimWrapperConstructor',
clip_grad=dict(max_norm=1.0, norm_type=2),
type='AmpOptimWrapper',
loss_scale='dynamic')
param_scheduler = [
dict(
type='LinearLR', begin=0, end=500, start_factor=0.0001,
by_epoch=False),
dict(
type='MultiStepLR',
begin=0,
end=210,
milestones=[170, 200],
gamma=0.1,
by_epoch=True)
]
auto_scale_lr = dict(base_batch_size=512)
codec = dict(
type='UDPHeatmap', input_size=(192, 256), heatmap_size=(48, 64), sigma=2)
model = dict(
type='TopdownPoseEstimator',
data_preprocessor=dict(
type='PoseDataPreprocessor',
mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
bgr_to_rgb=True),
backbone=dict(
# type='mmcls.VisionTransformer',
type='mmpretrain.VisionTransformer',
arch='large',
img_size=(256, 192),
patch_size=16,
qkv_bias=True,
drop_path_rate=0.5,
with_cls_token=False,
out_type='featmap',
# output_cls_token=False,
patch_cfg=dict(padding=2),
init_cfg=dict(
type='Pretrained',
checkpoint=
r".\vitpose_cocowbf_pfv1_68kpts.pth"
)
),
head=dict(
type='HeatmapHead',
in_channels=1024,
out_channels=68,
deconv_out_channels=(256, 256),
deconv_kernel_sizes=(4, 4),
loss=dict(type='KeypointMSELoss', use_target_weight=True),
decoder=dict(
type='UDPHeatmap',
input_size=(192, 256),
heatmap_size=(48, 64),
sigma=2)),
test_cfg=dict(flip_test=True, flip_mode='heatmap', shift_heatmap=False))
data_root = r"."
dataset_type = 'CocoWholeBodyFaceDataset'
data_mode = 'topdown'
train_pipeline = [
dict(type='LoadImage'),
dict(type='GetBBoxCenterScale'),
dict(type='RandomFlip', direction='horizontal'),
dict(type='RandomHalfBody'),
dict(type='RandomBBoxTransform'),
dict(type='TopdownAffine', input_size=(192, 256), use_udp=True),
dict(
type='GenerateTarget',
encoder=dict(
type='UDPHeatmap',
input_size=(192, 256),
heatmap_size=(48, 64),
sigma=2)),
dict(type='PackPoseInputs')
]
val_pipeline = [
dict(type='LoadImage'),
dict(type='GetBBoxCenterScale'),
dict(type='TopdownAffine', input_size=(192, 256), use_udp=True),
dict(type='PackPoseInputs')
]
train_dataloader = dict(
batch_size=8,
num_workers=4,
persistent_workers=True,
sampler=dict(type='DefaultSampler', shuffle=True),
dataset=dict(
data_mode='topdown',
ann_file=r".\train.json",
pipeline=[
dict(type='LoadImage'),
dict(type='GetBBoxCenterScale'),
dict(type='RandomFlip', direction='horizontal'),
dict(type='RandomHalfBody'),
dict(type='RandomBBoxTransform'),
dict(type='TopdownAffine', input_size=(192, 256), use_udp=True),
dict(
type='GenerateTarget',
encoder=dict(
type='UDPHeatmap',
input_size=(192, 256),
heatmap_size=(48, 64),
sigma=2)),
dict(type='PackPoseInputs')
]))
val_dataloader = dict(
batch_size=4,
num_workers=1,
persistent_workers=True,
drop_last=False,
sampler=dict(type='DefaultSampler', shuffle=False, round_up=False),
dataset=dict(
data_mode='topdown',
ann_file=r".\val.json",
bbox_file=None,
test_mode=True,
pipeline=[
dict(type='LoadImage'),
dict(type='GetBBoxCenterScale'),
dict(type='TopdownAffine', input_size=(192, 256), use_udp=True),
dict(type='PackPoseInputs')
]))
test_dataloader = dict(
batch_size=4,
num_workers=1,
persistent_workers=True,
drop_last=False,
sampler=dict(type='DefaultSampler', shuffle=False, round_up=False),
dataset=dict(
data_mode='topdown',
ann_file=r".\test.json",
bbox_file=None,
test_mode=True,
pipeline=[
dict(type='LoadImage'),
dict(type='GetBBoxCenterScale'),
dict(type='TopdownAffine', input_size=(192, 256), use_udp=True),
dict(type='PackPoseInputs')
]))
val_evaluator = dict(type='NME', norm_mode='keypoint_distance')
test_evaluator = dict(type='NME', norm_mode='keypoint_distance')
# model_wrapper_cfg = dict(type='MMFullyShardedDataParallel', cpu_offload=True)
launcher = 'none'
work_dir=r"./"