29 changed files with 3992 additions and 62 deletions
@ -0,0 +1,157 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/ap10k.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
log_config = dict( |
|||
interval=1, |
|||
hooks=[ |
|||
dict(type='TextLoggerHook'), |
|||
# dict(type='TensorboardLoggerHook') |
|||
]) |
|||
|
|||
channel_cfg = dict( |
|||
num_output_channels=17, |
|||
dataset_joints=17, |
|||
dataset_channel=[ |
|||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
|||
]) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=768, |
|||
depth=12, |
|||
num_heads=12, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=768, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=True, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='', |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/apt36k' |
|||
data = dict( |
|||
samples_per_gpu=32, |
|||
workers_per_gpu=4, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/train_annotations_1.json', |
|||
img_prefix=f'{data_root}/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/val_annotations_1.json', |
|||
img_prefix=f'{data_root}/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/val_annotations_1.json', |
|||
img_prefix=f'{data_root}/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,157 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/ap10k.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
log_config = dict( |
|||
interval=1, |
|||
hooks=[ |
|||
dict(type='TextLoggerHook'), |
|||
# dict(type='TensorboardLoggerHook') |
|||
]) |
|||
|
|||
channel_cfg = dict( |
|||
num_output_channels=17, |
|||
dataset_joints=17, |
|||
dataset_channel=[ |
|||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
|||
]) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=1280, |
|||
depth=32, |
|||
num_heads=16, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=1280, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=True, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='', |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/ap10k' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=4, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/ap10k-train-split1.json', |
|||
img_prefix=f'{data_root}/data/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/ap10k-val-split1.json', |
|||
img_prefix=f'{data_root}/data/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/ap10k-test-split1.json', |
|||
img_prefix=f'{data_root}/data/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,157 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/ap10k.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
log_config = dict( |
|||
interval=1, |
|||
hooks=[ |
|||
dict(type='TextLoggerHook'), |
|||
# dict(type='TensorboardLoggerHook') |
|||
]) |
|||
|
|||
channel_cfg = dict( |
|||
num_output_channels=17, |
|||
dataset_joints=17, |
|||
dataset_channel=[ |
|||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
|||
]) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=1024, |
|||
depth=24, |
|||
num_heads=16, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=1024, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=True, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='', |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/ap10k' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=4, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/ap10k-train-split1.json', |
|||
img_prefix=f'{data_root}/data/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/ap10k-val-split1.json', |
|||
img_prefix=f'{data_root}/data/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/ap10k-test-split1.json', |
|||
img_prefix=f'{data_root}/data/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,157 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/ap10k.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
log_config = dict( |
|||
interval=1, |
|||
hooks=[ |
|||
dict(type='TextLoggerHook'), |
|||
# dict(type='TensorboardLoggerHook') |
|||
]) |
|||
|
|||
channel_cfg = dict( |
|||
num_output_channels=17, |
|||
dataset_joints=17, |
|||
dataset_channel=[ |
|||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
|||
]) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=384, |
|||
depth=12, |
|||
num_heads=12, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=384, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=True, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='', |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/ap10k' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=4, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/ap10k-train-split1.json', |
|||
img_prefix=f'{data_root}/data/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/ap10k-val-split1.json', |
|||
img_prefix=f'{data_root}/data/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/ap10k-test-split1.json', |
|||
img_prefix=f'{data_root}/data/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,157 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/ap10k.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
log_config = dict( |
|||
interval=1, |
|||
hooks=[ |
|||
dict(type='TextLoggerHook'), |
|||
# dict(type='TensorboardLoggerHook') |
|||
]) |
|||
|
|||
channel_cfg = dict( |
|||
num_output_channels=17, |
|||
dataset_joints=17, |
|||
dataset_channel=[ |
|||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
|||
]) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=768, |
|||
depth=12, |
|||
num_heads=12, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=768, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=True, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='', |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/ap10k' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=4, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/ap10k-train-split1.json', |
|||
img_prefix=f'{data_root}/data/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/ap10k-val-split1.json', |
|||
img_prefix=f'{data_root}/data/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/ap10k-test-split1.json', |
|||
img_prefix=f'{data_root}/data/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,157 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/ap10k.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
log_config = dict( |
|||
interval=1, |
|||
hooks=[ |
|||
dict(type='TextLoggerHook'), |
|||
# dict(type='TensorboardLoggerHook') |
|||
]) |
|||
|
|||
channel_cfg = dict( |
|||
num_output_channels=17, |
|||
dataset_joints=17, |
|||
dataset_channel=[ |
|||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
|||
]) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=1280, |
|||
depth=32, |
|||
num_heads=16, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=1280, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=True, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='', |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/apt36k' |
|||
data = dict( |
|||
samples_per_gpu=32, |
|||
workers_per_gpu=4, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/train_annotations_1.json', |
|||
img_prefix=f'{data_root}/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/val_annotations_1.json', |
|||
img_prefix=f'{data_root}/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/val_annotations_1.json', |
|||
img_prefix=f'{data_root}/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,157 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/ap10k.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
log_config = dict( |
|||
interval=1, |
|||
hooks=[ |
|||
dict(type='TextLoggerHook'), |
|||
# dict(type='TensorboardLoggerHook') |
|||
]) |
|||
|
|||
channel_cfg = dict( |
|||
num_output_channels=17, |
|||
dataset_joints=17, |
|||
dataset_channel=[ |
|||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
|||
]) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=1024, |
|||
depth=24, |
|||
num_heads=16, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=1024, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=True, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='', |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/apt36k' |
|||
data = dict( |
|||
samples_per_gpu=32, |
|||
workers_per_gpu=4, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/train_annotations_1.json', |
|||
img_prefix=f'{data_root}/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/val_annotations_1.json', |
|||
img_prefix=f'{data_root}/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/val_annotations_1.json', |
|||
img_prefix=f'{data_root}/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,157 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/ap10k.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
log_config = dict( |
|||
interval=1, |
|||
hooks=[ |
|||
dict(type='TextLoggerHook'), |
|||
# dict(type='TensorboardLoggerHook') |
|||
]) |
|||
|
|||
channel_cfg = dict( |
|||
num_output_channels=17, |
|||
dataset_joints=17, |
|||
dataset_channel=[ |
|||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
|||
]) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=384, |
|||
depth=12, |
|||
num_heads=12, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=384, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=True, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='', |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/apt36k' |
|||
data = dict( |
|||
samples_per_gpu=32, |
|||
workers_per_gpu=4, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/train_annotations_1.json', |
|||
img_prefix=f'{data_root}/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/val_annotations_1.json', |
|||
img_prefix=f'{data_root}/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{data_root}/annotations/val_annotations_1.json', |
|||
img_prefix=f'{data_root}/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,151 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/aic.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
channel_cfg = dict( |
|||
num_output_channels=14, |
|||
dataset_joints=14, |
|||
dataset_channel=[ |
|||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], |
|||
], |
|||
inference_channel=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=384, |
|||
depth=12, |
|||
num_heads=12, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=384, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=True, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='data/coco/person_detection_results/' |
|||
'COCO_val2017_detections_AP_H_56_person.json', |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/aic' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=2, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='TopDownAicDataset', |
|||
ann_file=f'{data_root}/annotations/aic_train.json', |
|||
img_prefix=f'{data_root}/ai_challenger_keypoint_train_20170902/' |
|||
'keypoint_train_images_20170902/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='TopDownAicDataset', |
|||
ann_file=f'{data_root}/annotations/aic_val.json', |
|||
img_prefix=f'{data_root}/ai_challenger_keypoint_validation_20170911/' |
|||
'keypoint_validation_images_20170911/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='TopDownAicDataset', |
|||
ann_file=f'{data_root}/annotations/aic_val.json', |
|||
img_prefix=f'{data_root}/ai_challenger_keypoint_validation_20170911/' |
|||
'keypoint_validation_images_20170911/', |
|||
data_cfg=data_cfg, |
|||
pipeline=test_pipeline, |
|||
dataset_info={{_base_.dataset_info}})) |
@ -0,0 +1,170 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/coco.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict(type='AdamW', lr=5e-4, betas=(0.9, 0.999), weight_decay=0.1, |
|||
constructor='LayerDecayOptimizerConstructor', |
|||
paramwise_cfg=dict( |
|||
num_layers=12, |
|||
layer_decay_rate=0.9, |
|||
custom_keys={ |
|||
'bias': dict(decay_multi=0.), |
|||
'pos_embed': dict(decay_mult=0.), |
|||
'relative_position_bias_table': dict(decay_mult=0.), |
|||
'norm': dict(decay_mult=0.) |
|||
} |
|||
) |
|||
) |
|||
|
|||
optimizer_config = dict(grad_clip=dict(max_norm=1., norm_type=2)) |
|||
|
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
target_type = 'GaussianHeatmap' |
|||
channel_cfg = dict( |
|||
num_output_channels=17, |
|||
dataset_joints=17, |
|||
dataset_channel=[ |
|||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
|||
]) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=384, |
|||
depth=12, |
|||
num_heads=12, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=384, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=False, |
|||
target_type=target_type, |
|||
modulate_kernel=11, |
|||
use_udp=True)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=False, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='data/coco/person_detection_results/' |
|||
'COCO_val2017_detections_AP_H_56_person.json', |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine', use_udp=True), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='TopDownGenerateTarget', |
|||
sigma=2, |
|||
encoding='UDP', |
|||
target_type=target_type), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine', use_udp=True), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/coco' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=4, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='TopDownCocoDataset', |
|||
ann_file=f'{data_root}/annotations/person_keypoints_train2017.json', |
|||
img_prefix=f'{data_root}/train2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='TopDownCocoDataset', |
|||
ann_file=f'{data_root}/annotations/person_keypoints_val2017.json', |
|||
img_prefix=f'{data_root}/val2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='TopDownCocoDataset', |
|||
ann_file=f'{data_root}/annotations/person_keypoints_val2017.json', |
|||
img_prefix=f'{data_root}/val2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=test_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
|||
|
@ -0,0 +1,170 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/coco.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict(type='AdamW', lr=5e-4, betas=(0.9, 0.999), weight_decay=0.1, |
|||
constructor='LayerDecayOptimizerConstructor', |
|||
paramwise_cfg=dict( |
|||
num_layers=12, |
|||
layer_decay_rate=0.9, |
|||
custom_keys={ |
|||
'bias': dict(decay_multi=0.), |
|||
'pos_embed': dict(decay_mult=0.), |
|||
'relative_position_bias_table': dict(decay_mult=0.), |
|||
'norm': dict(decay_mult=0.) |
|||
} |
|||
) |
|||
) |
|||
|
|||
optimizer_config = dict(grad_clip=dict(max_norm=1., norm_type=2)) |
|||
|
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
target_type = 'GaussianHeatmap' |
|||
channel_cfg = dict( |
|||
num_output_channels=17, |
|||
dataset_joints=17, |
|||
dataset_channel=[ |
|||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
|||
]) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=384, |
|||
depth=12, |
|||
num_heads=12, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=384, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=False, |
|||
target_type=target_type, |
|||
modulate_kernel=11, |
|||
use_udp=True)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=False, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='data/coco/person_detection_results/' |
|||
'COCO_val2017_detections_AP_H_56_person.json', |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine', use_udp=True), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='TopDownGenerateTarget', |
|||
sigma=2, |
|||
encoding='UDP', |
|||
target_type=target_type), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine', use_udp=True), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/coco' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=4, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='TopDownCocoDataset', |
|||
ann_file=f'{data_root}/annotations/person_keypoints_train2017.json', |
|||
img_prefix=f'{data_root}/train2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='TopDownCocoDataset', |
|||
ann_file=f'{data_root}/annotations/person_keypoints_val2017.json', |
|||
img_prefix=f'{data_root}/val2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='TopDownCocoDataset', |
|||
ann_file=f'{data_root}/annotations/person_keypoints_val2017.json', |
|||
img_prefix=f'{data_root}/val2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=test_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
|||
|
@ -0,0 +1,491 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/coco.py', |
|||
'../../../../_base_/datasets/aic_info.py', |
|||
'../../../../_base_/datasets/mpii_info.py', |
|||
'../../../../_base_/datasets/ap10k_info.py', |
|||
'../../../../_base_/datasets/coco_wholebody_info.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict(type='AdamW', lr=1e-3, betas=(0.9, 0.999), weight_decay=0.1, |
|||
constructor='LayerDecayOptimizerConstructor', |
|||
paramwise_cfg=dict( |
|||
num_layers=12, |
|||
layer_decay_rate=0.9, |
|||
custom_keys={ |
|||
'bias': dict(decay_multi=0.), |
|||
'pos_embed': dict(decay_mult=0.), |
|||
'relative_position_bias_table': dict(decay_mult=0.), |
|||
'norm': dict(decay_mult=0.) |
|||
} |
|||
) |
|||
) |
|||
|
|||
optimizer_config = dict(grad_clip=dict(max_norm=1., norm_type=2)) |
|||
|
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
target_type = 'GaussianHeatmap' |
|||
channel_cfg = dict( |
|||
num_output_channels=17, |
|||
dataset_joints=17, |
|||
dataset_channel=[ |
|||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
|||
]) |
|||
aic_channel_cfg = dict( |
|||
num_output_channels=14, |
|||
dataset_joints=14, |
|||
dataset_channel=[ |
|||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], |
|||
], |
|||
inference_channel=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]) |
|||
mpii_channel_cfg = dict( |
|||
num_output_channels=16, |
|||
dataset_joints=16, |
|||
dataset_channel=list(range(16)), |
|||
inference_channel=list(range(16))) |
|||
crowdpose_channel_cfg = dict( |
|||
num_output_channels=14, |
|||
dataset_joints=14, |
|||
dataset_channel=[ |
|||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], |
|||
], |
|||
inference_channel=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]) |
|||
ap10k_channel_cfg = dict( |
|||
num_output_channels=17, |
|||
dataset_joints=17, |
|||
dataset_channel=[ |
|||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
|||
]) |
|||
cocowholebody_channel_cfg = dict( |
|||
num_output_channels=133, |
|||
dataset_joints=133, |
|||
dataset_channel=[ |
|||
list(range(133)), |
|||
], |
|||
inference_channel=list(range(133))) |
|||
|
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDownMoE', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViTMoE', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=384, |
|||
depth=12, |
|||
num_heads=12, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
num_expert=6, |
|||
part_features=192 |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=384, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
associate_keypoint_head=[ |
|||
dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=384, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=aic_channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=384, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=mpii_channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=384, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=ap10k_channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=384, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=ap10k_channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=384, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=cocowholebody_channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
], |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=False, |
|||
target_type=target_type, |
|||
modulate_kernel=11, |
|||
use_udp=True)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=False, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='data/coco/person_detection_results/' |
|||
'COCO_val2017_detections_AP_H_56_person.json', |
|||
max_num_joints=133, |
|||
dataset_idx=0, |
|||
) |
|||
|
|||
aic_data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=aic_channel_cfg['num_output_channels'], |
|||
num_joints=aic_channel_cfg['dataset_joints'], |
|||
dataset_channel=aic_channel_cfg['dataset_channel'], |
|||
inference_channel=aic_channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=True, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='data/coco/person_detection_results/' |
|||
'COCO_val2017_detections_AP_H_56_person.json', |
|||
max_num_joints=133, |
|||
dataset_idx=1, |
|||
) |
|||
|
|||
mpii_data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=mpii_channel_cfg['num_output_channels'], |
|||
num_joints=mpii_channel_cfg['dataset_joints'], |
|||
dataset_channel=mpii_channel_cfg['dataset_channel'], |
|||
inference_channel=mpii_channel_cfg['inference_channel'], |
|||
max_num_joints=133, |
|||
dataset_idx=2, |
|||
use_gt_bbox=True, |
|||
bbox_file=None, |
|||
) |
|||
|
|||
ap10k_data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=True, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='', |
|||
max_num_joints=133, |
|||
dataset_idx=3, |
|||
) |
|||
|
|||
ap36k_data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=True, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='', |
|||
max_num_joints=133, |
|||
dataset_idx=4, |
|||
) |
|||
|
|||
cocowholebody_data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=cocowholebody_channel_cfg['num_output_channels'], |
|||
num_joints=cocowholebody_channel_cfg['dataset_joints'], |
|||
dataset_channel=cocowholebody_channel_cfg['dataset_channel'], |
|||
inference_channel=cocowholebody_channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=False, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='data/coco/person_detection_results/' |
|||
'COCO_val2017_detections_AP_H_56_person.json', |
|||
dataset_idx=5, |
|||
max_num_joints=133, |
|||
) |
|||
|
|||
cocowholebody_train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs', 'dataset_idx' |
|||
]), |
|||
] |
|||
|
|||
ap10k_train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs', 'dataset_idx' |
|||
]), |
|||
] |
|||
|
|||
aic_train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs', 'dataset_idx' |
|||
]), |
|||
] |
|||
|
|||
mpii_train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine', use_udp=True), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='TopDownGenerateTarget', |
|||
sigma=2, |
|||
encoding='UDP', |
|||
target_type=target_type), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'flip_pairs', 'dataset_idx' |
|||
]), |
|||
] |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine', use_udp=True), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='TopDownGenerateTarget', |
|||
sigma=2, |
|||
encoding='UDP', |
|||
target_type=target_type), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs', 'dataset_idx' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine', use_udp=True), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs', 'dataset_idx' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/coco' |
|||
aic_data_root = 'data/aic' |
|||
mpii_data_root = 'data/mpii' |
|||
ap10k_data_root = 'data/ap10k' |
|||
ap36k_data_root = 'data/ap36k' |
|||
|
|||
data = dict( |
|||
samples_per_gpu=128, |
|||
workers_per_gpu=8, |
|||
val_dataloader=dict(samples_per_gpu=64), |
|||
test_dataloader=dict(samples_per_gpu=64), |
|||
train=[ |
|||
dict( |
|||
type='TopDownCocoDataset', |
|||
ann_file=f'{data_root}/annotations/person_keypoints_train2017.json', |
|||
img_prefix=f'{data_root}/train2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
dict( |
|||
type='TopDownAicDataset', |
|||
ann_file=f'{aic_data_root}/annotations/person_keypoints_train2017.json', |
|||
img_prefix=f'{aic_data_root}/ai_challenger_keypoint_train_20170909/' |
|||
'keypoint_train_images_20170902/', |
|||
data_cfg=aic_data_cfg, |
|||
pipeline=aic_train_pipeline, |
|||
dataset_info={{_base_.aic_info}}), |
|||
dict( |
|||
type='TopDownMpiiDataset', |
|||
ann_file=f'{mpii_data_root}/annotations/mpii_train.json', |
|||
img_prefix=f'{mpii_data_root}/images/', |
|||
data_cfg=mpii_data_cfg, |
|||
pipeline=mpii_train_pipeline, |
|||
dataset_info={{_base_.mpii_info}}), |
|||
dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{ap10k_data_root}/annotations/ap10k-train-split1.json', |
|||
img_prefix=f'{ap10k_data_root}/data/', |
|||
data_cfg=ap10k_data_cfg, |
|||
pipeline=ap10k_train_pipeline, |
|||
dataset_info={{_base_.ap10k_info}}), |
|||
dict( |
|||
type='AnimalAP10KDataset', |
|||
ann_file=f'{ap36k_data_root}/annotations/train_annotations_1.json', |
|||
img_prefix=f'{ap36k_data_root}/', |
|||
data_cfg=ap36k_data_cfg, |
|||
pipeline=ap10k_train_pipeline, |
|||
dataset_info={{_base_.ap10k_info}}), |
|||
dict( |
|||
type='TopDownCocoWholeBodyDataset', |
|||
ann_file=f'{data_root}/annotations/coco_wholebody_train_v1.0.json', |
|||
img_prefix=f'{data_root}/train2017/', |
|||
data_cfg=cocowholebody_data_cfg, |
|||
pipeline=cocowholebody_train_pipeline, |
|||
dataset_info={{_base_.cocowholebody_info}}), |
|||
], |
|||
val=dict( |
|||
type='TopDownCocoDataset', |
|||
ann_file=f'{data_root}/annotations/person_keypoints_val2017.json', |
|||
img_prefix=f'{data_root}/val2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='TopDownCocoDataset', |
|||
ann_file=f'{data_root}/annotations/person_keypoints_val2017.json', |
|||
img_prefix=f'{data_root}/val2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=test_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
|||
|
@ -0,0 +1,146 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/mpii.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='PCKh', save_best='PCKh') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
log_config = dict( |
|||
interval=50, hooks=[ |
|||
dict(type='TextLoggerHook'), |
|||
]) |
|||
|
|||
target_type = 'GaussianHeatmap' |
|||
channel_cfg = dict( |
|||
num_output_channels=16, |
|||
dataset_joints=16, |
|||
dataset_channel=list(range(16)), |
|||
inference_channel=list(range(16))) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=384, |
|||
depth=12, |
|||
num_heads=12, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=384, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=False, |
|||
target_type=target_type, |
|||
modulate_kernel=11, |
|||
use_udp=True)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
use_gt_bbox=True, |
|||
bbox_file=None, |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine', use_udp=True), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='TopDownGenerateTarget', |
|||
sigma=2, |
|||
encoding='UDP', |
|||
target_type=target_type), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine', use_udp=True), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=['image_file', 'center', 'scale', 'rotation', 'flip_pairs']), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/mpii' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=2, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='TopDownMpiiDataset', |
|||
ann_file=f'{data_root}/annotations/mpii_train.json', |
|||
img_prefix=f'{data_root}/images/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='TopDownMpiiDataset', |
|||
ann_file=f'{data_root}/annotations/mpii_val.json', |
|||
img_prefix=f'{data_root}/images/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='TopDownMpiiDataset', |
|||
ann_file=f'{data_root}/annotations/mpii_val.json', |
|||
img_prefix=f'{data_root}/images/', |
|||
data_cfg=data_cfg, |
|||
pipeline=test_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,153 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/ochuman.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
channel_cfg = dict( |
|||
num_output_channels=17, |
|||
dataset_joints=17, |
|||
dataset_channel=[ |
|||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
|||
]) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=384, |
|||
depth=12, |
|||
num_heads=12, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=384, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=True, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='data/coco/person_detection_results/' |
|||
'COCO_val2017_detections_AP_H_56_person.json', |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/ochuman' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=2, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='TopDownCocoDataset', |
|||
ann_file='data/coco/annotations/person_keypoints_train2017.json', |
|||
img_prefix='data/coco//train2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='TopDownOCHumanDataset', |
|||
ann_file=f'{data_root}/annotations/' |
|||
'ochuman_coco_format_val_range_0.00_1.00.json', |
|||
img_prefix=f'{data_root}/images/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='TopDownOCHumanDataset', |
|||
ann_file=f'{data_root}/annotations/' |
|||
'ochuman_coco_format_test_range_0.00_1.00.json', |
|||
img_prefix=f'{data_root}/images/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,162 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/interhand2d.py' |
|||
] |
|||
checkpoint_config = dict(interval=5) |
|||
evaluation = dict(interval=5, metric=['PCK', 'AUC', 'EPE'], save_best='AUC') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[40, 50]) |
|||
total_epochs = 60 |
|||
log_config = dict( |
|||
interval=20, |
|||
hooks=[ |
|||
dict(type='TextLoggerHook'), |
|||
# dict(type='TensorboardLoggerHook') |
|||
]) |
|||
|
|||
channel_cfg = dict( |
|||
num_output_channels=21, |
|||
dataset_joints=21, |
|||
dataset_channel=[ |
|||
[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, |
|||
19, 20 |
|||
], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, |
|||
20 |
|||
]) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=768, |
|||
depth=12, |
|||
num_heads=12, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=768, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel']) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=90, scale_factor=0.3), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=['image_file', 'center', 'scale', 'rotation', 'flip_pairs']), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/interhand2.6m' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=2, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='InterHand2DDataset', |
|||
ann_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_train_data.json', |
|||
camera_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_train_camera.json', |
|||
joint_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_train_joint_3d.json', |
|||
img_prefix=f'{data_root}/images/train/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='InterHand2DDataset', |
|||
ann_file=f'{data_root}/annotations/machine_annot/' |
|||
'InterHand2.6M_val_data.json', |
|||
camera_file=f'{data_root}/annotations/machine_annot/' |
|||
'InterHand2.6M_val_camera.json', |
|||
joint_file=f'{data_root}/annotations/machine_annot/' |
|||
'InterHand2.6M_val_joint_3d.json', |
|||
img_prefix=f'{data_root}/images/val/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='InterHand2DDataset', |
|||
ann_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_test_data.json', |
|||
camera_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_test_camera.json', |
|||
joint_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_test_joint_3d.json', |
|||
img_prefix=f'{data_root}/images/test/', |
|||
data_cfg=data_cfg, |
|||
pipeline=test_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,162 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/interhand2d.py' |
|||
] |
|||
checkpoint_config = dict(interval=5) |
|||
evaluation = dict(interval=5, metric=['PCK', 'AUC', 'EPE'], save_best='AUC') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[40, 50]) |
|||
total_epochs = 60 |
|||
log_config = dict( |
|||
interval=20, |
|||
hooks=[ |
|||
dict(type='TextLoggerHook'), |
|||
# dict(type='TensorboardLoggerHook') |
|||
]) |
|||
|
|||
channel_cfg = dict( |
|||
num_output_channels=21, |
|||
dataset_joints=21, |
|||
dataset_channel=[ |
|||
[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, |
|||
19, 20 |
|||
], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, |
|||
20 |
|||
]) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=1280, |
|||
depth=32, |
|||
num_heads=16, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=1280, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel']) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=90, scale_factor=0.3), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=['image_file', 'center', 'scale', 'rotation', 'flip_pairs']), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/interhand2.6m' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=2, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='InterHand2DDataset', |
|||
ann_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_train_data.json', |
|||
camera_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_train_camera.json', |
|||
joint_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_train_joint_3d.json', |
|||
img_prefix=f'{data_root}/images/train/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='InterHand2DDataset', |
|||
ann_file=f'{data_root}/annotations/machine_annot/' |
|||
'InterHand2.6M_val_data.json', |
|||
camera_file=f'{data_root}/annotations/machine_annot/' |
|||
'InterHand2.6M_val_camera.json', |
|||
joint_file=f'{data_root}/annotations/machine_annot/' |
|||
'InterHand2.6M_val_joint_3d.json', |
|||
img_prefix=f'{data_root}/images/val/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='InterHand2DDataset', |
|||
ann_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_test_data.json', |
|||
camera_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_test_camera.json', |
|||
joint_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_test_joint_3d.json', |
|||
img_prefix=f'{data_root}/images/test/', |
|||
data_cfg=data_cfg, |
|||
pipeline=test_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,162 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/interhand2d.py' |
|||
] |
|||
checkpoint_config = dict(interval=5) |
|||
evaluation = dict(interval=5, metric=['PCK', 'AUC', 'EPE'], save_best='AUC') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[40, 50]) |
|||
total_epochs = 60 |
|||
log_config = dict( |
|||
interval=20, |
|||
hooks=[ |
|||
dict(type='TextLoggerHook'), |
|||
# dict(type='TensorboardLoggerHook') |
|||
]) |
|||
|
|||
channel_cfg = dict( |
|||
num_output_channels=21, |
|||
dataset_joints=21, |
|||
dataset_channel=[ |
|||
[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, |
|||
19, 20 |
|||
], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, |
|||
20 |
|||
]) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=1024, |
|||
depth=24, |
|||
num_heads=16, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=1024, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel']) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=90, scale_factor=0.3), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=['image_file', 'center', 'scale', 'rotation', 'flip_pairs']), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/interhand2.6m' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=2, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='InterHand2DDataset', |
|||
ann_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_train_data.json', |
|||
camera_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_train_camera.json', |
|||
joint_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_train_joint_3d.json', |
|||
img_prefix=f'{data_root}/images/train/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='InterHand2DDataset', |
|||
ann_file=f'{data_root}/annotations/machine_annot/' |
|||
'InterHand2.6M_val_data.json', |
|||
camera_file=f'{data_root}/annotations/machine_annot/' |
|||
'InterHand2.6M_val_camera.json', |
|||
joint_file=f'{data_root}/annotations/machine_annot/' |
|||
'InterHand2.6M_val_joint_3d.json', |
|||
img_prefix=f'{data_root}/images/val/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='InterHand2DDataset', |
|||
ann_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_test_data.json', |
|||
camera_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_test_camera.json', |
|||
joint_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_test_joint_3d.json', |
|||
img_prefix=f'{data_root}/images/test/', |
|||
data_cfg=data_cfg, |
|||
pipeline=test_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,162 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/interhand2d.py' |
|||
] |
|||
checkpoint_config = dict(interval=5) |
|||
evaluation = dict(interval=5, metric=['PCK', 'AUC', 'EPE'], save_best='AUC') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[40, 50]) |
|||
total_epochs = 60 |
|||
log_config = dict( |
|||
interval=20, |
|||
hooks=[ |
|||
dict(type='TextLoggerHook'), |
|||
# dict(type='TensorboardLoggerHook') |
|||
]) |
|||
|
|||
channel_cfg = dict( |
|||
num_output_channels=21, |
|||
dataset_joints=21, |
|||
dataset_channel=[ |
|||
[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, |
|||
19, 20 |
|||
], |
|||
], |
|||
inference_channel=[ |
|||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, |
|||
20 |
|||
]) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=384, |
|||
depth=12, |
|||
num_heads=12, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=384, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel']) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=90, scale_factor=0.3), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=['image_file', 'center', 'scale', 'rotation', 'flip_pairs']), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/interhand2.6m' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=2, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='InterHand2DDataset', |
|||
ann_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_train_data.json', |
|||
camera_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_train_camera.json', |
|||
joint_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_train_joint_3d.json', |
|||
img_prefix=f'{data_root}/images/train/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='InterHand2DDataset', |
|||
ann_file=f'{data_root}/annotations/machine_annot/' |
|||
'InterHand2.6M_val_data.json', |
|||
camera_file=f'{data_root}/annotations/machine_annot/' |
|||
'InterHand2.6M_val_camera.json', |
|||
joint_file=f'{data_root}/annotations/machine_annot/' |
|||
'InterHand2.6M_val_joint_3d.json', |
|||
img_prefix=f'{data_root}/images/val/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='InterHand2DDataset', |
|||
ann_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_test_data.json', |
|||
camera_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_test_camera.json', |
|||
joint_file=f'{data_root}/annotations/all/' |
|||
'InterHand2.6M_test_joint_3d.json', |
|||
img_prefix=f'{data_root}/images/test/', |
|||
data_cfg=data_cfg, |
|||
pipeline=test_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,149 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/coco_wholebody.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
channel_cfg = dict( |
|||
num_output_channels=133, |
|||
dataset_joints=133, |
|||
dataset_channel=[ |
|||
list(range(133)), |
|||
], |
|||
inference_channel=list(range(133))) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=768, |
|||
depth=12, |
|||
num_heads=12, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=768, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=False, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='data/coco/person_detection_results/' |
|||
'COCO_val2017_detections_AP_H_56_person.json', |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/coco' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=2, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='TopDownCocoWholeBodyDataset', |
|||
ann_file=f'{data_root}/annotations/coco_wholebody_train_v1.0.json', |
|||
img_prefix=f'{data_root}/train2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='TopDownCocoWholeBodyDataset', |
|||
ann_file=f'{data_root}/annotations/coco_wholebody_val_v1.0.json', |
|||
img_prefix=f'{data_root}/val2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='TopDownCocoWholeBodyDataset', |
|||
ann_file=f'{data_root}/annotations/coco_wholebody_val_v1.0.json', |
|||
img_prefix=f'{data_root}/val2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=test_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,149 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/coco_wholebody.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
channel_cfg = dict( |
|||
num_output_channels=133, |
|||
dataset_joints=133, |
|||
dataset_channel=[ |
|||
list(range(133)), |
|||
], |
|||
inference_channel=list(range(133))) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=1280, |
|||
depth=32, |
|||
num_heads=16, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=1280, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=False, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='data/coco/person_detection_results/' |
|||
'COCO_val2017_detections_AP_H_56_person.json', |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/coco' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=2, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='TopDownCocoWholeBodyDataset', |
|||
ann_file=f'{data_root}/annotations/coco_wholebody_train_v1.0.json', |
|||
img_prefix=f'{data_root}/train2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='TopDownCocoWholeBodyDataset', |
|||
ann_file=f'{data_root}/annotations/coco_wholebody_val_v1.0.json', |
|||
img_prefix=f'{data_root}/val2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='TopDownCocoWholeBodyDataset', |
|||
ann_file=f'{data_root}/annotations/coco_wholebody_val_v1.0.json', |
|||
img_prefix=f'{data_root}/val2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=test_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,149 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/coco_wholebody.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
channel_cfg = dict( |
|||
num_output_channels=133, |
|||
dataset_joints=133, |
|||
dataset_channel=[ |
|||
list(range(133)), |
|||
], |
|||
inference_channel=list(range(133))) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=1024, |
|||
depth=24, |
|||
num_heads=16, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=1024, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=False, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='data/coco/person_detection_results/' |
|||
'COCO_val2017_detections_AP_H_56_person.json', |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/coco' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=2, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='TopDownCocoWholeBodyDataset', |
|||
ann_file=f'{data_root}/annotations/coco_wholebody_train_v1.0.json', |
|||
img_prefix=f'{data_root}/train2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='TopDownCocoWholeBodyDataset', |
|||
ann_file=f'{data_root}/annotations/coco_wholebody_val_v1.0.json', |
|||
img_prefix=f'{data_root}/val2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='TopDownCocoWholeBodyDataset', |
|||
ann_file=f'{data_root}/annotations/coco_wholebody_val_v1.0.json', |
|||
img_prefix=f'{data_root}/val2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=test_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
@ -0,0 +1,149 @@ |
|||
_base_ = [ |
|||
'../../../../_base_/default_runtime.py', |
|||
'../../../../_base_/datasets/coco_wholebody.py' |
|||
] |
|||
evaluation = dict(interval=10, metric='mAP', save_best='AP') |
|||
|
|||
optimizer = dict( |
|||
type='Adam', |
|||
lr=5e-4, |
|||
) |
|||
optimizer_config = dict(grad_clip=None) |
|||
# learning policy |
|||
lr_config = dict( |
|||
policy='step', |
|||
warmup='linear', |
|||
warmup_iters=500, |
|||
warmup_ratio=0.001, |
|||
step=[170, 200]) |
|||
total_epochs = 210 |
|||
channel_cfg = dict( |
|||
num_output_channels=133, |
|||
dataset_joints=133, |
|||
dataset_channel=[ |
|||
list(range(133)), |
|||
], |
|||
inference_channel=list(range(133))) |
|||
|
|||
# model settings |
|||
model = dict( |
|||
type='TopDown', |
|||
pretrained=None, |
|||
backbone=dict( |
|||
type='ViT', |
|||
img_size=(256, 192), |
|||
patch_size=16, |
|||
embed_dim=384, |
|||
depth=12, |
|||
num_heads=12, |
|||
ratio=1, |
|||
use_checkpoint=False, |
|||
mlp_ratio=4, |
|||
qkv_bias=True, |
|||
drop_path_rate=0.3, |
|||
), |
|||
keypoint_head=dict( |
|||
type='TopdownHeatmapSimpleHead', |
|||
in_channels=384, |
|||
num_deconv_layers=2, |
|||
num_deconv_filters=(256, 256), |
|||
num_deconv_kernels=(4, 4), |
|||
extra=dict(final_conv_kernel=1, ), |
|||
out_channels=channel_cfg['num_output_channels'], |
|||
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), |
|||
train_cfg=dict(), |
|||
test_cfg=dict( |
|||
flip_test=True, |
|||
post_process='default', |
|||
shift_heatmap=True, |
|||
modulate_kernel=11)) |
|||
|
|||
data_cfg = dict( |
|||
image_size=[192, 256], |
|||
heatmap_size=[48, 64], |
|||
num_output_channels=channel_cfg['num_output_channels'], |
|||
num_joints=channel_cfg['dataset_joints'], |
|||
dataset_channel=channel_cfg['dataset_channel'], |
|||
inference_channel=channel_cfg['inference_channel'], |
|||
soft_nms=False, |
|||
nms_thr=1.0, |
|||
oks_thr=0.9, |
|||
vis_thr=0.2, |
|||
use_gt_bbox=False, |
|||
det_bbox_thr=0.0, |
|||
bbox_file='data/coco/person_detection_results/' |
|||
'COCO_val2017_detections_AP_H_56_person.json', |
|||
) |
|||
|
|||
train_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownRandomFlip', flip_prob=0.5), |
|||
dict( |
|||
type='TopDownHalfBodyTransform', |
|||
num_joints_half_body=8, |
|||
prob_half_body=0.3), |
|||
dict( |
|||
type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict(type='TopDownGenerateTarget', sigma=2), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img', 'target', 'target_weight'], |
|||
meta_keys=[ |
|||
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale', |
|||
'rotation', 'bbox_score', 'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
val_pipeline = [ |
|||
dict(type='LoadImageFromFile'), |
|||
dict(type='TopDownAffine'), |
|||
dict(type='ToTensor'), |
|||
dict( |
|||
type='NormalizeTensor', |
|||
mean=[0.485, 0.456, 0.406], |
|||
std=[0.229, 0.224, 0.225]), |
|||
dict( |
|||
type='Collect', |
|||
keys=['img'], |
|||
meta_keys=[ |
|||
'image_file', 'center', 'scale', 'rotation', 'bbox_score', |
|||
'flip_pairs' |
|||
]), |
|||
] |
|||
|
|||
test_pipeline = val_pipeline |
|||
|
|||
data_root = 'data/coco' |
|||
data = dict( |
|||
samples_per_gpu=64, |
|||
workers_per_gpu=2, |
|||
val_dataloader=dict(samples_per_gpu=32), |
|||
test_dataloader=dict(samples_per_gpu=32), |
|||
train=dict( |
|||
type='TopDownCocoWholeBodyDataset', |
|||
ann_file=f'{data_root}/annotations/coco_wholebody_train_v1.0.json', |
|||
img_prefix=f'{data_root}/train2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=train_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
val=dict( |
|||
type='TopDownCocoWholeBodyDataset', |
|||
ann_file=f'{data_root}/annotations/coco_wholebody_val_v1.0.json', |
|||
img_prefix=f'{data_root}/val2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=val_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
test=dict( |
|||
type='TopDownCocoWholeBodyDataset', |
|||
ann_file=f'{data_root}/annotations/coco_wholebody_val_v1.0.json', |
|||
img_prefix=f'{data_root}/val2017/', |
|||
data_cfg=data_cfg, |
|||
pipeline=test_pipeline, |
|||
dataset_info={{_base_.dataset_info}}), |
|||
) |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 103 KiB |
@ -0,0 +1,93 @@ |
|||
import torch |
|||
import os |
|||
import argparse |
|||
import copy |
|||
|
|||
def parse_args(): |
|||
parser = argparse.ArgumentParser() |
|||
parser.add_argument('--source', type=str) |
|||
parser.add_argument('--target', type=str, default=None) |
|||
args = parser.parse_args() |
|||
return args |
|||
|
|||
def main(): |
|||
|
|||
args = parse_args() |
|||
|
|||
if args.target is None: |
|||
args.target = '/'.join(args.source.split('/')[:-1]) |
|||
|
|||
ckpt = torch.load(args.source, map_location='cpu') |
|||
|
|||
experts = dict() |
|||
|
|||
new_ckpt = copy.deepcopy(ckpt) |
|||
|
|||
state_dict = new_ckpt['state_dict'] |
|||
|
|||
for key, value in state_dict.items(): |
|||
if 'mlp.experts' in key: |
|||
experts[key] = value |
|||
|
|||
keys = ckpt['state_dict'].keys() |
|||
|
|||
target_expert = 0 |
|||
new_ckpt = copy.deepcopy(ckpt) |
|||
|
|||
for key in keys: |
|||
if 'mlp.fc2' in key: |
|||
value = new_ckpt['state_dict'][key] |
|||
value = torch.cat([value, experts[key.replace('fc2.', f'experts.{target_expert}.')]], dim=0) |
|||
new_ckpt['state_dict'][key] = value |
|||
|
|||
torch.save(new_ckpt, os.path.join(args.targetPath, 'coco.pth')) |
|||
|
|||
names = ['aic', 'mpii', 'ap10k', 'apt36k','wholebody'] |
|||
num_keypoints = [14, 16, 17, 17, 133] |
|||
weight_names = ['keypoint_head.deconv_layers.0.weight', |
|||
'keypoint_head.deconv_layers.1.weight', |
|||
'keypoint_head.deconv_layers.1.bias', |
|||
'keypoint_head.deconv_layers.1.running_mean', |
|||
'keypoint_head.deconv_layers.1.running_var', |
|||
'keypoint_head.deconv_layers.1.num_batches_tracked', |
|||
'keypoint_head.deconv_layers.3.weight', |
|||
'keypoint_head.deconv_layers.4.weight', |
|||
'keypoint_head.deconv_layers.4.bias', |
|||
'keypoint_head.deconv_layers.4.running_mean', |
|||
'keypoint_head.deconv_layers.4.running_var', |
|||
'keypoint_head.deconv_layers.4.num_batches_tracked', |
|||
'keypoint_head.final_layer.weight', |
|||
'keypoint_head.final_layer.bias'] |
|||
|
|||
exist_range = True |
|||
|
|||
for i in range(5): |
|||
|
|||
new_ckpt = copy.deepcopy(ckpt) |
|||
|
|||
target_expert = i + 1 |
|||
|
|||
for key in keys: |
|||
if 'mlp.fc2' in key: |
|||
expert_key = key.replace('fc2.', f'experts.{target_expert}.') |
|||
if expert_key in experts: |
|||
value = new_ckpt['state_dict'][key] |
|||
value = torch.cat([value, experts[expert_key]], dim=0) |
|||
else: |
|||
exist_range = False |
|||
|
|||
new_ckpt['state_dict'][key] = value |
|||
|
|||
if not exist_range: |
|||
break |
|||
|
|||
for tensor_name in weight_names: |
|||
new_ckpt['state_dict'][tensor_name] = new_ckpt['state_dict'][tensor_name.replace('keypoint_head', f'associate_keypoint_heads.{i}')] |
|||
|
|||
for tensor_name in ['keypoint_head.final_layer.weight', 'keypoint_head.final_layer.bias']: |
|||
new_ckpt['state_dict'][tensor_name] = new_ckpt['state_dict'][tensor_name][:num_keypoints[i]] |
|||
|
|||
torch.save(new_ckpt, os.path.join(args.target, f'{names[i]}.pth')) |
|||
|
|||
if __name__ == '__main__': |
|||
main() |
Loading…
Reference in new issue