Safemotion Lib
Loading...
Searching...
No Matches
posec3d_pose_fl.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=2,
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 MutiTaskSigmoidFocalLoss = 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 )
63)
64metric_args = dict(pred_key=['pred_pose', 'pred_hand', 'pred_foot'],
65 gt_key=['label', 'label', 'label'],
66 target_tasks=['pose', 'hand', 'foot'],
67 task_key='category')
68
69
70collect_keys = ['pose_heatmap', 'label']
71
72data_loader = dict(
73 type = 'ActionDatasetLoader_v22',
74 data_folder = '/media/safemotion/HDD5/pjm_test/action_train_dataset_2023/action_v22_1st_split',
75 category_info = dict(pose = 8,
76 hand = 2,
77 foot = 2),
78 clip_len = 8,
79)
80ep_mul = 20
81train = dict(
82 num_workers = 8,
83 init_lr = 0.2,
84 batch_size = 32,
85 epochs = 150*ep_mul,
86 optimizer = 'SGD',
87 optimizer_args = dict(momentum=0.9, nesterov=True, weight_decay=0.0001),
88 scheduler = 'CosineAnnealingLR',
89 scheduler_args = dict(T_max=30*ep_mul, eta_min=0),
90 adjust_lr_epoch = [30*ep_mul, 90*ep_mul, 150*ep_mul],
91 adjust_lr_rate = [0.5]*3,
92 val_interval = 1,
93
94
95 update_loss_weight = False,
96 update_loss_weight_interval = 20,
97 base_weight = 0.5,
98
99
100 pretrained = None,#'/media/safemotion/HDD5/pjm_test/action_train_test/9.pth',
101 save_root = '/media/safemotion/HDD5/pjm_test/action_train_result/pose_1st_fl',
102
103)
104
105test = dict(
106 model_path = '',
107 save_root = '',
108)