forked from firework8/BRL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
k.py
73 lines (68 loc) · 2.7 KB
/
k.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
model = dict(
type='MixRecognizerGCN',
backbone=dict(
type='STGCN',
gcn_adaptive='init',
gcn_with_res=True,
tcn_type='mstcn',
graph_cfg=dict(layout='nturgb+d', mode='spatial')),
cls_head=dict(type='MixAAHead', num_classes=60, in_channels=256))
dataset_type = 'PoseDataset'
ann_file = '/data/lhd/pyskl_data/nturgbd/ntu60_3danno.pkl'
imb_factor = '100'
sampel_class_prob = []
train_pipeline = [
dict(type='PreNormalize3D'),
dict(type='RandomScale', scale=0.1),
dict(type='RandomRot'),
dict(type='Spatial_Flip', dataset='nturgb+d', p=0.5),
dict(type='GenSkeFeat', dataset='nturgb+d', feats=['k']),
dict(type='UniformSample', clip_len=64),
dict(type='PoseDecode'),
dict(type='FormatGCNInput', num_person=2),
dict(type='Collect', keys=['keypoint', 'label'], meta_keys=[]),
dict(type='ToTensor', keys=['keypoint'])
]
val_pipeline = [
dict(type='PreNormalize3D'),
dict(type='GenSkeFeat', dataset='nturgb+d', feats=['k']),
dict(type='UniformSample', clip_len=64, num_clips=1, test_mode=True),
dict(type='PoseDecode'),
dict(type='FormatGCNInput', num_person=2),
dict(type='Collect', keys=['keypoint', 'label'], meta_keys=[]),
dict(type='ToTensor', keys=['keypoint'])
]
test_pipeline = [
dict(type='PreNormalize3D'),
dict(type='GenSkeFeat', dataset='nturgb+d', feats=['k']),
dict(type='UniformSample', clip_len=64, num_clips=10, test_mode=True),
dict(type='PoseDecode'),
dict(type='FormatGCNInput', num_person=2),
dict(type='Collect', keys=['keypoint', 'label'], meta_keys=[]),
dict(type='ToTensor', keys=['keypoint'])
]
data = dict(
videos_per_gpu=16,
workers_per_gpu=2,
test_dataloader=dict(videos_per_gpu=1),
train=dict(
type='RepeatDataset',
times=5,
num_classes=60,
data_list_path='./data/NTU60_LT/NTU60_xsub_exp_'+imb_factor+'.txt',
dataset=dict(type=dataset_type, ann_file=ann_file, pipeline=train_pipeline,
class_prob=sampel_class_prob, split='xsub_train')),
val=dict(type=dataset_type, ann_file=ann_file, pipeline=val_pipeline, split='xsub_val'),
test=dict(type=dataset_type, ann_file=ann_file, pipeline=test_pipeline, split='xsub_val'))
# optimizer
optimizer = dict(type='SGD', lr=0.0125, momentum=0.9, weight_decay=0.0005, nesterov=True)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(policy='CosineAnnealing', min_lr=0, by_epoch=False)
total_epochs = 24
checkpoint_config = dict(interval=1)
evaluation = dict(interval=1, metrics=['top_k_accuracy'])
log_config = dict(interval=100, hooks=[dict(type='TextLoggerHook')])
# runtime settings
log_level = 'INFO'
work_dir = './work_dirs/stgcn_LT/ntu60_xsub_LT/k'