Safemotion Lib
Loading...
Searching...
No Matches
posec3d_pose_2nd.py
Go to the documentation of this file.
1model = dict(
2 type='ActionRecognitionRunner',
3 backbone=dict(
4 resnet3d = dict(
5 type='ResNet3d',
6 in_channels = 17,
7 base_channels = 32,
8 stage_blocks = (4, 6, 3),
9 out_indices = (2, ),
10 spatial_strides = (2, 2, 2),
11 temporal_strides = (1, 1, 2),
12 dilations = (1, 1, 1),
13 conv1_kernel = (1, 7, 7),
14 conv1_stride_s = 1,
15 conv1_stride_t = 1,
16 pool1_stride_s = 1,
17 pool1_stride_t = 1,
18 inflate = (0, 1, 1),
19 inflate_style = '3x1x1',
20 input_key = 'pose_heatmap'
21 ),
22 ),
23 head=dict(
24 pose = dict(
25 type='I3DHead',
26 in_channels=512,
27 num_classes=8,
28 dropout_ratio=0.5,
29 input_key = 'resnet3d',
30 ),
31 hand = dict(
32 type='I3DHead',
33 in_channels=512,
34 num_classes=4,
35 dropout_ratio=0.5,
36 input_key = 'resnet3d',
37 ),
38 foot = dict(
39 type='I3DHead',
40 in_channels=512,
41 num_classes=2,
42 dropout_ratio=0.5,
43 input_key = 'resnet3d',
44 ),
45 ),
46 predict_keys = dict(
47 #예측한 라벨의 키 = 헤드의 키(스코어의 키)
48 pred_pose = 'pose',
49 pred_hand = 'hand',
50 pred_foot = 'foot',
51 )
52)
53
54loss = dict(
55 MutiTaskCrossEntropyLoss = dict(
56 weight = 1.0,
57 task_key = 'category',
58 pred_keys = ['pose', 'hand', 'foot'],
59 gt_keys = ['label', 'label', 'label'],
60 target_tasks = ['pose', 'hand', 'foot'],
61 weights = [1.0, 1.0, 1.0],
62 # data_num = dict(action = [100, 100, 100, 24, 100, 34, 3, 100, 100], pose = [98, 517, 11, 35])
63 )
64)
65metric_args = dict(pred_key=['pred_pose', 'pred_hand', 'pred_foot'],
66 gt_key=['label', 'label', 'label'],
67 target_tasks=['pose', 'hand', 'foot'],
68 task_key='category')
69
70
71collect_keys = ['pose_heatmap', 'label']
72
73data_loader = dict(
74 type = 'ActionDatasetLoader_v22',
75 data_folder = '/media/safemotion/HDD5/pjm_test/action_train_dataset_2023/action_v22_2nd_split',
76 category_info = dict(pose = 8,
77 hand = 4,
78 foot = 2),
79 clip_len = 8,
80)
81ep_mul = 20
82train = dict(
83 num_workers = 8,
84 init_lr = 0.2,
85 batch_size = 32,
86 epochs = 150*ep_mul,
87 optimizer = 'SGD',
88 optimizer_args = dict(momentum=0.9, nesterov=True, weight_decay=0.0001),
89 scheduler = 'CosineAnnealingLR',
90 scheduler_args = dict(T_max=30*ep_mul, eta_min=0),
91 adjust_lr_epoch = [30*ep_mul, 90*ep_mul, 150*ep_mul],
92 adjust_lr_rate = [0.5]*3,
93 val_interval = 1,
94
95 update_loss_weight = False,
96 update_loss_weight_interval = 20,
97 base_weight = 0.5,
98
99 pretrained = None,#'/media/safemotion/HDD5/pjm_test/action_train_test/9.pth',
100 save_root = '/media/safemotion/HDD5/pjm_test/action_train_result/pose_2nd',
101
102)
103
104test = dict(
105 model_path = None,#'/media/safemotion/HDD5/pjm_test/action_train_result/1st/weights/2835.pth',
106 save_root = '',
107)