-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconvert_script.txt
207 lines (156 loc) · 6.71 KB
/
convert_script.txt
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
ACTIVATION_ANGLE=90
############ Add
OP=Add
LOWEROP=${OP,,}
NUM_BATCHES=1
OPSET=11
sog4onnx \
--op_type ${OP} \
--opset ${OPSET} \
--op_name ${LOWEROP}${OPSET} \
--input_variables whenet_a float32 [${NUM_BATCHES},3] \
--input_variables 6drepnet_b float32 [${NUM_BATCHES},3] \
--output_variables yaw_roll_pitch float32 [${NUM_BATCHES},3] \
--output_onnx_file_path ${OP}${OPSET}_merged_add.onnx
############ WHENet shrink
snc4onnx \
--input_onnx_file_paths whenet_1x3x224x224_prepost.onnx shrunk_whenet_${ACTIVATION_ANGLE}.onnx \
--srcop_destop yaw_roll_pitch shrunk_input \
--output_onnx_file_path whenet_prepost_disable_front_side_detection_1x3x224x224.onnx
onnxsim whenet_prepost_disable_front_side_detection_1x3x224x224.onnx whenet_prepost_disable_front_side_detection_1x3x224x224.onnx
############ 6DRepNet shrink
snc4onnx \
--input_onnx_file_paths sixdrepnet_300w_lp_maskplus_prepost_1x3x224x224.onnx shrunk_6drepnet_${ACTIVATION_ANGLE}.onnx \
--srcop_destop output_6drep_yaw_roll_pitch shrunk_input \
--output_onnx_file_path sixdrepnet_300w_lp_maskplus_prepost_disable_rear_side_detection_1x3x224x224.onnx
onnxsim sixdrepnet_300w_lp_maskplus_prepost_disable_rear_side_detection_1x3x224x224.onnx sixdrepnet_300w_lp_maskplus_prepost_disable_rear_side_detection_1x3x224x224.onnx
############ WHENet + 6DRepNet
snc4onnx \
--input_onnx_file_paths whenet_prepost_disable_front_side_detection_1x3x224x224.onnx sixdrepnet_300w_lp_maskplus_prepost_disable_rear_side_detection_1x3x224x224.onnx \
--srcop_destop input input \
--op_prefixes_after_merging whenet 6drepnet \
--output_onnx_file_path dmhead_merged.onnx
############ outputs rename
sor4onnx \
--input_onnx_file_path dmhead_merged.onnx \
--old_new "whenet_whenet_" "whenet_" \
--mode outputs \
--output_onnx_file_path dmhead_merged.onnx
sor4onnx \
--input_onnx_file_path dmhead_merged.onnx \
--old_new "6drepnet_6drepnet_" "6drepnet_" \
--mode outputs \
--output_onnx_file_path dmhead_merged.onnx
############ dmhead_merged + Add
snc4onnx \
--input_onnx_file_paths dmhead_merged.onnx Add11_merged_add.onnx \
--srcop_destop whenet_shrunk_output whenet_a 6drepnet_shrunk_output 6drepnet_b \
--output_onnx_file_path dmhead_mask_1x3x224x224.onnx
onnxsim dmhead_mask_1x3x224x224.onnx dmhead_mask_1x3x224x224.onnx
N-Batch ###########################################################################################################
############ Add
OP=Add
LOWEROP=${OP,,}
OPSET=11
sog4onnx \
--op_type ${OP} \
--opset ${OPSET} \
--op_name ${LOWEROP}${OPSET} \
--input_variables whenet_a float32 [\'N\',3] \
--input_variables 6drepnet_b float32 [\'N\',3] \
--output_variables yaw_roll_pitch float32 [\'N\',3] \
--output_onnx_file_path ${OP}${OPSET}_merged_add_N.onnx
############ WHENet shrink
snc4onnx \
--input_onnx_file_paths whenet_Nx3x224x224_prepost.onnx shrunk_whenet_N_${ACTIVATION_ANGLE}.onnx \
--srcop_destop yaw_roll_pitch shrunk_input \
--output_onnx_file_path whenet_prepost_disable_front_side_detection_Nx3x224x224.onnx
############ 6DRepNet shrink
snc4onnx \
--input_onnx_file_paths sixdrepnet_300w_lp_maskplus_prepost_Nx3x224x224.onnx shrunk_6drepnet_N_${ACTIVATION_ANGLE}.onnx \
--srcop_destop output_6drep_yaw_roll_pitch shrunk_input \
--output_onnx_file_path sixdrepnet_300w_lp_maskplus_prepost_disable_rear_side_detection_Nx3x224x224.onnx
############ WHENet + 6DRepNet
snc4onnx \
--input_onnx_file_paths whenet_prepost_disable_front_side_detection_Nx3x224x224.onnx sixdrepnet_300w_lp_maskplus_prepost_disable_rear_side_detection_Nx3x224x224.onnx \
--srcop_destop input input \
--op_prefixes_after_merging whenet 6drepnet \
--output_onnx_file_path dmhead_merged_N.onnx
############ outputs rename
sor4onnx \
--input_onnx_file_path dmhead_merged_N.onnx \
--old_new "whenet_whenet_" "whenet_" \
--mode outputs \
--output_onnx_file_path dmhead_merged_N.onnx
sor4onnx \
--input_onnx_file_path dmhead_merged_N.onnx \
--old_new "6drepnet_6drepnet_" "6drepnet_" \
--mode outputs \
--output_onnx_file_path dmhead_merged_N.onnx
############ dmhead_merged + Add
snc4onnx \
--input_onnx_file_paths dmhead_merged_N.onnx Add11_merged_add_N.onnx \
--srcop_destop whenet_shrunk_output whenet_a 6drepnet_shrunk_output 6drepnet_b \
--output_onnx_file_path dmhead_mask_Nx3x224x224.onnx
onnxsim dmhead_mask_Nx3x224x224.onnx dmhead_mask_Nx3x224x224.onnx
############ Add
OP=Add
LOWEROP=${OP,,}
OPSET=11
sog4onnx \
--op_type ${OP} \
--opset ${OPSET} \
--op_name ${LOWEROP}${OPSET} \
--input_variables whenet_a float32 [\'N\',3] \
--input_variables synergynet_b float32 [\'N\',3] \
--output_variables yaw_roll_pitch float32 [\'N\',3] \
--output_onnx_file_path ${OP}${OPSET}_merged_add_N.onnx
############ WHENet shrink
snc4onnx \
--input_onnx_file_paths whenet_Nx3x224x224_prepost.onnx shrunk_whenet_N_${ACTIVATION_ANGLE}.onnx \
--srcop_destop yaw_roll_pitch shrunk_input \
--output_onnx_file_path whenet_prepost_disable_front_side_detection_Nx3x224x224.onnx
sor4onnx \
--input_onnx_file_path synergynet_1x3x224x224.onnx \
--old_new "yaw_roll_pitch" "output_synergy_yaw_roll_pitch" \
--output_onnx_file_path synergynet_1x3x224x224.onnx \
--mode outputs
sor4onnx \
--input_onnx_file_path synergynet_Nx3x224x224.onnx \
--old_new "yaw_roll_pitch" "output_synergy_yaw_roll_pitch" \
--output_onnx_file_path synergynet_Nx3x224x224.onnx \
--mode outputs
sbi4onnx \
--input_onnx_file_path shrunk_whenet.onnx \
--output_onnx_file_path shrunk_whenet_N.onnx \
--initialization_character_string N
sbi4onnx \
--input_onnx_file_path shrunk_synergynet.onnx \
--output_onnx_file_path shrunk_synergynet_N.onnx \
--initialization_character_string N
############ SynergyNet shrink
snc4onnx \
--input_onnx_file_paths synergynet_Nx3x224x224.onnx shrunk_synergynet_N_${ACTIVATION_ANGLE}.onnx \
--srcop_destop output_synergy_yaw_roll_pitch shrunk_input \
--output_onnx_file_path synergynet_prepost_disable_rear_side_detection_Nx3x224x224.onnx
############ WHENet + SynergyNet
snc4onnx \
--input_onnx_file_paths whenet_prepost_disable_front_side_detection_Nx3x224x224.onnx synergynet_prepost_disable_rear_side_detection_Nx3x224x224.onnx \
--srcop_destop input input \
--op_prefixes_after_merging whenet synergynet \
--output_onnx_file_path dmhead_merged_N.onnx
sor4onnx \
--input_onnx_file_path dmhead_merged_N.onnx \
--old_new "whenet_whenet_shrunk_output" "whenet_shrunk_output" \
--output_onnx_file_path dmhead_merged_N.onnx \
--mode outputs
sor4onnx \
--input_onnx_file_path dmhead_merged_N.onnx \
--old_new "synergynet_synergynet_shrunk_output" "synergynet_shrunk_output" \
--output_onnx_file_path dmhead_merged_N.onnx \
--mode outputs
############ dmhead_merged + Add
snc4onnx \
--input_onnx_file_paths dmhead_merged_N.onnx Add11_merged_add_N.onnx \
--srcop_destop whenet_shrunk_output whenet_a synergynet_shrunk_output synergynet_b \
--output_onnx_file_path dmhead_nomask_Nx3x224x224.onnx