Upload aagcn/j_pretrained_otp2.py with huggingface_hub
Browse files- aagcn/j_pretrained_otp2.py +100 -0
aagcn/j_pretrained_otp2.py
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model = dict(
|
| 2 |
+
type='RecognizerGCN',
|
| 3 |
+
backbone=dict(type='AAGCN', graph_cfg=dict(layout='coco', mode='spatial')),
|
| 4 |
+
cls_head=dict(type='GCNHead', num_classes=28, in_channels=256))
|
| 5 |
+
dataset_type = 'PoseDataset'
|
| 6 |
+
train_pipeline = [
|
| 7 |
+
dict(type='PreNormalize2D'),
|
| 8 |
+
dict(type='GenSkeFeat', dataset='coco', feats=['j']),
|
| 9 |
+
dict(type='UniformSample', clip_len=100),
|
| 10 |
+
dict(type='PoseDecode'),
|
| 11 |
+
dict(type='FormatGCNInput', num_person=2),
|
| 12 |
+
dict(type='Collect', keys=['keypoint', 'label'], meta_keys=[]),
|
| 13 |
+
dict(type='ToTensor', keys=['keypoint'])
|
| 14 |
+
]
|
| 15 |
+
val_pipeline = [
|
| 16 |
+
dict(type='PreNormalize2D'),
|
| 17 |
+
dict(type='GenSkeFeat', dataset='coco', feats=['j']),
|
| 18 |
+
dict(type='UniformSample', clip_len=100, num_clips=1),
|
| 19 |
+
dict(type='PoseDecode'),
|
| 20 |
+
dict(type='FormatGCNInput', num_person=2),
|
| 21 |
+
dict(type='Collect', keys=['keypoint', 'label'], meta_keys=[]),
|
| 22 |
+
dict(type='ToTensor', keys=['keypoint'])
|
| 23 |
+
]
|
| 24 |
+
test_pipeline = [
|
| 25 |
+
dict(type='PreNormalize2D'),
|
| 26 |
+
dict(type='GenSkeFeat', dataset='coco', feats=['j']),
|
| 27 |
+
dict(type='UniformSample', clip_len=100, num_clips=10),
|
| 28 |
+
dict(type='PoseDecode'),
|
| 29 |
+
dict(type='FormatGCNInput', num_person=2),
|
| 30 |
+
dict(type='Collect', keys=['keypoint', 'label'], meta_keys=[]),
|
| 31 |
+
dict(type='ToTensor', keys=['keypoint'])
|
| 32 |
+
]
|
| 33 |
+
data = dict(
|
| 34 |
+
videos_per_gpu=16,
|
| 35 |
+
workers_per_gpu=1,
|
| 36 |
+
persistent_workers=True,
|
| 37 |
+
test_dataloader=dict(videos_per_gpu=1),
|
| 38 |
+
train=dict(
|
| 39 |
+
type='RepeatDataset',
|
| 40 |
+
times=5,
|
| 41 |
+
dataset=dict(
|
| 42 |
+
type='PoseDataset',
|
| 43 |
+
ann_file='data/pyskl_otp2.pkl',
|
| 44 |
+
pipeline=[
|
| 45 |
+
dict(type='PreNormalize2D'),
|
| 46 |
+
dict(type='GenSkeFeat', dataset='coco', feats=['j']),
|
| 47 |
+
dict(type='UniformSample', clip_len=100),
|
| 48 |
+
dict(type='PoseDecode'),
|
| 49 |
+
dict(type='FormatGCNInput', num_person=2),
|
| 50 |
+
dict(type='Collect', keys=['keypoint', 'label'], meta_keys=[]),
|
| 51 |
+
dict(type='ToTensor', keys=['keypoint'])
|
| 52 |
+
],
|
| 53 |
+
split='train')),
|
| 54 |
+
val=dict(
|
| 55 |
+
type='PoseDataset',
|
| 56 |
+
ann_file='data/pyskl_otp2.pkl',
|
| 57 |
+
pipeline=[
|
| 58 |
+
dict(type='PreNormalize2D'),
|
| 59 |
+
dict(type='GenSkeFeat', dataset='coco', feats=['j']),
|
| 60 |
+
dict(type='UniformSample', clip_len=100, num_clips=1),
|
| 61 |
+
dict(type='PoseDecode'),
|
| 62 |
+
dict(type='FormatGCNInput', num_person=2),
|
| 63 |
+
dict(type='Collect', keys=['keypoint', 'label'], meta_keys=[]),
|
| 64 |
+
dict(type='ToTensor', keys=['keypoint'])
|
| 65 |
+
],
|
| 66 |
+
split='val'),
|
| 67 |
+
test=dict(
|
| 68 |
+
type='PoseDataset',
|
| 69 |
+
ann_file='data/pyskl_otp2.pkl',
|
| 70 |
+
pipeline=[
|
| 71 |
+
dict(type='PreNormalize2D'),
|
| 72 |
+
dict(type='GenSkeFeat', dataset='coco', feats=['j']),
|
| 73 |
+
dict(type='UniformSample', clip_len=100, num_clips=10),
|
| 74 |
+
dict(type='PoseDecode'),
|
| 75 |
+
dict(type='FormatGCNInput', num_person=2),
|
| 76 |
+
dict(type='Collect', keys=['keypoint', 'label'], meta_keys=[]),
|
| 77 |
+
dict(type='ToTensor', keys=['keypoint'])
|
| 78 |
+
],
|
| 79 |
+
split='test'))
|
| 80 |
+
optimizer = dict(
|
| 81 |
+
type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005, nesterov=True)
|
| 82 |
+
optimizer_config = dict(grad_clip=None)
|
| 83 |
+
lr_config = dict(policy='CosineAnnealing', min_lr=0, by_epoch=False)
|
| 84 |
+
total_epochs = 24
|
| 85 |
+
checkpoint_config = dict(interval=2)
|
| 86 |
+
workflow = [('train', 1)]
|
| 87 |
+
evaluation = dict(
|
| 88 |
+
interval=1, metrics=['top_k_accuracy', 'mean_class_accuracy'], topk=(1, 5))
|
| 89 |
+
log_config = dict(interval=100, hooks=[dict(type='TextLoggerHook')])
|
| 90 |
+
dist_params = dict(backend='nccl')
|
| 91 |
+
log_level = 'INFO'
|
| 92 |
+
work_dir = './work_dirs/aagcn/otp2'
|
| 93 |
+
seed = 42
|
| 94 |
+
deterministic = True
|
| 95 |
+
cudnn_benchmark = False
|
| 96 |
+
cudnn_deterministic = True
|
| 97 |
+
load_from = 'https://download.openmmlab.com/mmaction/pyskl/ckpt/aagcn/aagcn_pyskl_ntu120_xsub_hrnet/j.pth'
|
| 98 |
+
resume_from = None
|
| 99 |
+
find_unused_parameters = False
|
| 100 |
+
gpu_ids = range(0, 1)
|