Safemotion Lib
Loading...
Searching...
No Matches
posec3d_action_demo.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 MutiTaskCrossEntropyLoss = 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 # data_num = dict(action = [100, 100, 100, 24, 100, 34, 3, 100, 100], pose = [98, 517, 11, 35])
60 )
61)
62
63metric_args = dict(pred_key=pred_keys,
64 gt_key=gt_keys,
65 target_tasks=target_tasks,
66 task_key='category')
67
68collect_keys = ['pose_heatmap', 'label']
69
70data_loader = dict(
71 type = 'ActionDatasetLoader_v22',
72 data_folder = '/media/safemotion/HDD5/pjm_test/action_train_dataset_2023/action_v22_1st_split',
73 category_info = dict(action_upper = 6,
74 action_lower = 12),
75 clip_len = 20,
76)
77ep_mul = 20
78train = dict(
79 num_workers = 8,
80 init_lr = 0.2,
81 batch_size = 32,
82 epochs = 150*ep_mul,
83 optimizer = 'SGD',
84 optimizer_args = dict(momentum=0.9, nesterov=True, weight_decay=0.0001),
85 # scheduler = 'CosineAnnealingLR',
86 scheduler = 'StepLR',
87 scheduler_args = dict(T_max=30*ep_mul, eta_min=0),
88 adjust_lr_epoch = [10*ep_mul, 50*ep_mul, 100*ep_mul, 130*ep_mul],
89 adjust_lr_rate = [0.5, 0.1, 0.1, 0.1],
90 val_interval = 1,
91
92
93 update_loss_weight = False,
94 update_loss_weight_interval = 20,
95 base_weight = 0.5,
96
97 pretrained = None,#'/media/safemotion/HDD5/pjm_test/action_train_test/9.pth',
98 save_root = '/media/safemotion/HDD5/pjm_test/action_train_result/action_2st',
99
100)
101
102test = dict(
103 model_path = '/media/safemotion/HDD5/pjm_test/action_train_result/1st/weights/2835.pth',
104 save_root = '',
105)