Safemotion Lib
Loading...
Searching...
No Matches
posec3d_action_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 = 64,
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 action_upper = dict(
25 type='I3DHead',
26 in_channels=1024,
27 num_classes=6,
28 dropout_ratio=0.5,
29 input_key = 'resnet3d',
30 ),
31 action_lower = dict(
32 type='I3DHead',
33 in_channels=1024,
34 num_classes=12,
35 dropout_ratio=0.5,
36 input_key = 'resnet3d',
37 ),
38 ),
39 predict_keys = dict(
40 #예측한 라벨의 키 = 헤드의 키(스코어의 키)
41 pred_action_upper = 'action_upper',
42 pred_action_lower = 'action_lower',
43 )
44)
45
46score_keys = ['action_upper', 'action_lower']
47pred_keys = ['pred_action_upper', 'pred_action_lower']
48gt_keys = ['label', 'label']
49target_tasks = ['action_upper', 'action_lower']
50
51loss = dict(
52 MutiTaskSigmoidFocalLoss = dict(
53 weight = 1.0,
54 task_key = 'category',
55 pred_keys = score_keys,
56 gt_keys = gt_keys,
57 target_tasks = target_tasks,
58 weights = [1.0, 1.0],
59 )
60)
61
62metric_args = dict(pred_key=pred_keys,
63 gt_key=gt_keys,
64 target_tasks=target_tasks,
65 task_key='category')
66
67collect_keys = ['pose_heatmap', 'label']
68
69data_loader = dict(
70 type = 'ActionDatasetLoader_v22',
71 data_folder = '/media/safemotion/HDD5/pjm_test/action_train_dataset_2023/action_v22_1st_split',
72 category_info = dict(action_upper = 6,
73 action_lower = 12),
74 clip_len = 20,
75)
76ep_mul = 20
77train = dict(
78 num_workers = 8,
79 init_lr = 0.2,
80 batch_size = 32,
81 epochs = 150*ep_mul,
82 optimizer = 'SGD',
83 optimizer_args = dict(momentum=0.9, nesterov=True, weight_decay=0.0001),
84 scheduler = 'CosineAnnealingLR',
85 # scheduler = 'StepLR',
86 scheduler_args = dict(T_max=30*ep_mul, eta_min=0),
87 adjust_lr_epoch = [10*ep_mul, 50*ep_mul, 100*ep_mul, 130*ep_mul],
88 adjust_lr_rate = [0.5, 0.1, 0.1, 0.1],
89 val_interval = 1,
90
91
92 update_loss_weight = False,
93 update_loss_weight_interval = 20,
94 base_weight = 0.5,
95
96 pretrained = None,#'/media/safemotion/HDD5/pjm_test/action_train_test/9.pth',
97 save_root = '/media/safemotion/HDD5/pjm_test/action_train_result/action_1st_fl',
98
99)
100
101test = dict(
102 model_path = None,
103 save_root = '',
104)