-
Notifications
You must be signed in to change notification settings - Fork 3
/
convert_script.txt
575 lines (452 loc) · 18.4 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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
python convert_onnx.py
onnxsim yolact_edge_mobilenetv2_54_800000.onnx yolact_edge_mobilenetv2_54_800000.onnx
onnxsim yolact_edge_mobilenetv2_54_800000.onnx yolact_edge_mobilenetv2_54_800000.onnx
onnxsim yolact_edge_mobilenetv2_54_800000.onnx yolact_edge_mobilenetv2_54_800000.onnx
onnxsim yolact_edge_mobilenetv2_54_800000.onnx yolact_edge_mobilenetv2_54_800000.onnx
python nms_yolact_edge.py
docker run --gpus all -it --rm \
-v `pwd`:/home/user/workdir \
ghcr.io/pinto0309/tflite2tensorflow:latest
tflite2tensorflow \
--model_path nms_yolact_edge.tflite \
--flatc_path ../flatc \
--schema_path ../schema.fbs \
--output_pb \
--optimizing_for_openvino_and_myriad
tflite2tensorflow \
--model_path nms_yolact_edge.tflite \
--flatc_path ../flatc \
--schema_path ../schema.fbs \
--output_onnx \
--onnx_opset 11
mv saved_model/model_float32.onnx nms_yolact_edge.onnx
onnxsim nms_yolact_edge.onnx nms_yolact_edge.onnx
onnxsim nms_yolact_edge.onnx nms_yolact_edge.onnx
onnxsim nms_yolact_edge.onnx nms_yolact_edge.onnx
onnxsim nms_yolact_edge.onnx nms_yolact_edge.onnx
sor4onnx \
--input_onnx_file_path nms_yolact_edge.onnx \
--old_new "input_1" "nms_boxes" \
--output_onnx_file_path nms_yolact_edge.onnx \
--mode inputs
sor4onnx \
--input_onnx_file_path nms_yolact_edge.onnx \
--old_new "input_2" "nms_scores" \
--output_onnx_file_path nms_yolact_edge.onnx \
--mode inputs
sor4onnx \
--input_onnx_file_path nms_yolact_edge.onnx \
--old_new "input_3" "nms_classes" \
--output_onnx_file_path nms_yolact_edge.onnx \
--mode inputs
sor4onnx \
--input_onnx_file_path nms_yolact_edge.onnx \
--old_new "input_4" "nms_masks" \
--output_onnx_file_path nms_yolact_edge.onnx \
--mode inputs
sor4onnx \
--input_onnx_file_path nms_yolact_edge.onnx \
--old_new "input_5" "nms_proto" \
--output_onnx_file_path nms_yolact_edge.onnx \
--mode inputs
sor4onnx \
--input_onnx_file_path nms_yolact_edge.onnx \
--old_new "Identity_1" "proto_out" \
--output_onnx_file_path nms_yolact_edge.onnx \
--mode outputs
sor4onnx \
--input_onnx_file_path nms_yolact_edge.onnx \
--old_new "Identity" "x1y1x2y2_scores_classes_masks_4x1x1x32" \
--output_onnx_file_path nms_yolact_edge.onnx \
--mode outputs
snc4onnx \
--input_onnx_file_paths yolact_edge_mobilenetv2_54_800000.onnx nms_yolact_edge.onnx \
--op_prefixes_after_merging main post \
--srcop_destop boxes nms_boxes scores nms_scores classes nms_classes masks nms_masks proto nms_proto \
--output_onnx_file_path yolact_edge_mobilenetv2_550x550.onnx
sor4onnx \
--input_onnx_file_path yolact_edge_mobilenetv2_550x550.onnx \
--old_new "put" "input" \
--output_onnx_file_path yolact_edge_mobilenetv2_550x550.onnx \
--mode inputs
sor4onnx \
--input_onnx_file_path yolact_edge_mobilenetv2_550x550.onnx \
--old_new "post_x1y1x2y2_scores_classes_masks_4x1x1x32" "x1y1x2y2_scores_classes_masks_4x1x1x32" \
--output_onnx_file_path yolact_edge_mobilenetv2_550x550.onnx \
--mode outputs
sor4onnx \
--input_onnx_file_path yolact_edge_mobilenetv2_550x550.onnx \
--old_new "post_proto_out" "proto_out" \
--output_onnx_file_path yolact_edge_mobilenetv2_550x550.onnx \
--mode outputs
onnxsim yolact_edge_mobilenetv2_550x550.onnx yolact_edge_mobilenetv2_550x550.onnx
onnxsim yolact_edge_mobilenetv2_550x550.onnx yolact_edge_mobilenetv2_550x550.onnx
$INTEL_OPENVINO_DIR/deployment_tools/model_optimizer/mo.py \
--input_model yolact_edge_mobilenetv2_550x550.onnx \
--data_type FP32 \
--output_dir yolact_edge_mobilenetv2_550x550/openvino/FP32 \
--model_name yolact_edge_mobilenetv2_550x550
$INTEL_OPENVINO_DIR/deployment_tools/model_optimizer/mo.py \
--input_model yolact_edge_mobilenetv2_550x550.onnx \
--data_type FP16 \
--output_dir yolact_edge_mobilenetv2_550x550/openvino/FP16 \
--model_name yolact_edge_mobilenetv2_550x550
mkdir -p yolact_edge_mobilenetv2_550x550/openvino/myriad
${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/lib/intel64/myriad_compile \
-m yolact_edge_mobilenetv2_550x550/openvino/FP16/yolact_edge_mobilenetv2_550x550.xml \
-ip U8 \
-VPU_NUMBER_OF_SHAVES 6 \
-VPU_NUMBER_OF_CMX_SLICES 6 \
-o yolact_edge_mobilenetv2_550x550/openvino/myriad/yolact_edge_mobilenetv2_550x550.blob
New method #####################################################################################
############ xyxy -> yxyx
python nms_yolact_edge_xyxyx_yxyx.py
docker run --gpus all -it --rm \
-v `pwd`:/home/user/workdir \
ghcr.io/pinto0309/tflite2tensorflow:latest
tflite2tensorflow \
--model_path nms_yolact_edge_xyxy_yxyx.tflite \
--flatc_path ../flatc \
--schema_path ../schema.fbs \
--output_pb \
--optimizing_for_openvino_and_myriad
tflite2tensorflow \
--model_path nms_yolact_edge_xyxy_yxyx.tflite \
--flatc_path ../flatc \
--schema_path ../schema.fbs \
--output_onnx \
--onnx_opset 11
mv saved_model/model_float32.onnx nms_yolact_edge_xyxy_yxyx.onnx
onnxsim nms_yolact_edge_xyxy_yxyx.onnx nms_yolact_edge_xyxy_yxyx.onnx
onnxsim nms_yolact_edge_xyxy_yxyx.onnx nms_yolact_edge_xyxy_yxyx.onnx
onnxsim nms_yolact_edge_xyxy_yxyx.onnx nms_yolact_edge_xyxy_yxyx.onnx
onnxsim nms_yolact_edge_xyxy_yxyx.onnx nms_yolact_edge_xyxy_yxyx.onnx
sor4onnx \
--input_onnx_file_path nms_yolact_edge_xyxy_yxyx.onnx \
--old_new "Identity" "boxes_xyxy_var" \
--output_onnx_file_path nms_yolact_edge_xyxy_yxyx.onnx \
--mode outputs
############ NMS
sog4onnx \
--op_type Constant \
--opset 11 \
--op_name max_output_boxes_per_class_const \
--output_variables max_output_boxes_per_class int64 [1] \
--attributes value int64 [20] \
--output_onnx_file_path Constant_max_output_boxes_per_class.onnx
sog4onnx \
--op_type Constant \
--opset 11 \
--op_name iou_threshold_const \
--output_variables iou_threshold float32 [1] \
--attributes value float32 [0.5] \
--output_onnx_file_path Constant_iou_threshold.onnx
sog4onnx \
--op_type Constant \
--opset 11 \
--op_name score_threshold_const \
--output_variables score_threshold float32 [1] \
--attributes value float32 [0.4] \
--output_onnx_file_path Constant_score_threshold.onnx
OP=NonMaxSuppression
LOWEROP=${OP,,}
NUM_BATCHES=1
SPATIAL_DIMENSION=19248
NUM_CLASSES=80
OPSET=11
sog4onnx \
--op_type ${OP} \
--opset ${OPSET} \
--op_name ${LOWEROP}${OPSET} \
--input_variables boxes_var float32 [${NUM_BATCHES},${SPATIAL_DIMENSION},4] \
--input_variables scores_var float32 [${NUM_BATCHES},${NUM_CLASSES},${SPATIAL_DIMENSION}] \
--input_variables max_output_boxes_per_class_var int64 [1] \
--input_variables iou_threshold_var float32 [1] \
--input_variables score_threshold_var float32 [1] \
--output_variables selected_indices int64 [\'N\',3] \
--attributes center_point_box int64 0 \
--output_onnx_file_path ${OP}${OPSET}.onnx
snc4onnx \
--input_onnx_file_paths Constant_max_output_boxes_per_class.onnx NonMaxSuppression11.onnx \
--srcop_destop max_output_boxes_per_class max_output_boxes_per_class_var \
--output_onnx_file_path NonMaxSuppression11.onnx
snc4onnx \
--input_onnx_file_paths Constant_iou_threshold.onnx NonMaxSuppression11.onnx \
--srcop_destop iou_threshold iou_threshold_var \
--output_onnx_file_path NonMaxSuppression11.onnx
snc4onnx \
--input_onnx_file_paths Constant_score_threshold.onnx NonMaxSuppression11.onnx \
--srcop_destop score_threshold score_threshold_var \
--output_onnx_file_path NonMaxSuppression11.onnx
############ myriad workaround Mul
OP=Mul
LOWEROP=${OP,,}
NUM_BATCHES=1
OPSET=11
sog4onnx \
--op_type ${OP} \
--opset ${OPSET} \
--op_name ${LOWEROP}${OPSET} \
--input_variables workaround_mul_a int64 [\'N\',3] \
--input_variables workaround_mul_b int64 [1] \
--output_variables workaround_mul_out int64 [\'N\',3] \
--output_onnx_file_path ${OP}${OPSET}_workaround.onnx
############ myriad workaround Constant
sog4onnx \
--op_type Constant \
--opset 11 \
--op_name workaround_mul_const_op \
--output_variables workaround_mul_const int64 [1] \
--attributes value int64 [1] \
--output_onnx_file_path Constant_workaround_mul.onnx
############ myriad workaround Mul + myriad workaround Constant
snc4onnx \
--input_onnx_file_paths Constant_workaround_mul.onnx Mul11_workaround.onnx \
--srcop_destop workaround_mul_const workaround_mul_b \
--output_onnx_file_path Mul11_workaround.onnx
############ NMS + myriad workaround Mul
snc4onnx \
--input_onnx_file_paths NonMaxSuppression11.onnx Mul11_workaround.onnx \
--srcop_destop selected_indices workaround_mul_a \
--output_onnx_file_path NonMaxSuppression11.onnx
############ yxyx + NMS
snc4onnx \
--input_onnx_file_paths nms_yolact_edge_xyxy_yxyx.onnx NonMaxSuppression11.onnx \
--srcop_destop boxes_xyxy_var boxes_var \
--output_onnx_file_path NonMaxSuppression11.onnx
sor4onnx \
--input_onnx_file_path NonMaxSuppression11.onnx \
--old_new "input_1" "boxes_var" \
--output_onnx_file_path NonMaxSuppression11.onnx \
--mode inputs
############ NMS Slice
python nms_yolact_edge_score_indices.py
python -m tf2onnx.convert \
--opset 11 \
--tflite saved_model_postprocess/nms_yolact_edge_score_indices.tflite \
--output nms_yolact_edge_score_indices.onnx
onnxsim nms_yolact_edge_score_indices.onnx nms_yolact_edge_score_indices.onnx
onnxsim nms_yolact_edge_score_indices.onnx nms_yolact_edge_score_indices.onnx
sor4onnx \
--input_onnx_file_path nms_yolact_edge_score_indices.onnx \
--old_new "Identity_1" "box_indices_sliced" \
--output_onnx_file_path nms_yolact_edge_score_indices.onnx \
--mode outputs
sor4onnx \
--input_onnx_file_path nms_yolact_edge_score_indices.onnx \
--old_new "Identity" "classes_sliced" \
--output_onnx_file_path nms_yolact_edge_score_indices.onnx \
--mode outputs
sor4onnx \
--input_onnx_file_path nms_yolact_edge_score_indices.onnx \
--old_new "input_1" "selected_indices_before_slice" \
--output_onnx_file_path nms_yolact_edge_score_indices.onnx \
--mode inputs
############ Boxes gather
OP=Gather
LOWEROP=${OP,,}
NUM_BATCHES=1
SPATIAL_DIMENSION=19248
OPSET=11
sog4onnx \
--op_type ${OP} \
--opset ${OPSET} \
--op_name ${LOWEROP}${OPSET}_boxes \
--input_variables gat_boxes_var float32 [${NUM_BATCHES},${SPATIAL_DIMENSION},4] \
--input_variables gat_boxes_indices_var int64 [\'N\'] \
--output_variables gat_boxes_out float32 [${NUM_BATCHES},\'N\',4] \
--attributes axis int64 1 \
--output_onnx_file_path ${OP}${OPSET}_boxes.onnx
onnxsim ${OP}${OPSET}_boxes.onnx ${OP}${OPSET}_boxes.onnx
############ Masks gather
OP=Gather
LOWEROP=${OP,,}
NUM_BATCHES=1
SPATIAL_DIMENSION=19248
OPSET=11
sog4onnx \
--op_type ${OP} \
--opset ${OPSET} \
--op_name ${LOWEROP}${OPSET}_masks \
--input_variables gat_masks_var float32 [${NUM_BATCHES},${SPATIAL_DIMENSION},32] \
--input_variables gat_masks_indices_var int64 [\'N\'] \
--output_variables gat_masks_out float32 [${NUM_BATCHES},\'N\',32] \
--attributes axis int64 1 \
--output_onnx_file_path ${OP}${OPSET}_masks.onnx
onnxsim ${OP}${OPSET}_masks.onnx ${OP}${OPSET}_masks.onnx
############ NMS Slice + Boxes gather
snc4onnx \
--input_onnx_file_paths nms_yolact_edge_score_indices.onnx Gather11_boxes.onnx \
--srcop_destop box_indices_sliced gat_boxes_indices_var \
--output_onnx_file_path nms_yolact_edge_score_indices.onnx
############ NMS Slice + Masks gather
snc4onnx \
--input_onnx_file_paths nms_yolact_edge_score_indices.onnx Gather11_masks.onnx \
--srcop_destop box_indices_sliced gat_masks_indices_var \
--output_onnx_file_path nms_yolact_edge_score_indices.onnx
############ NMS + Sliced values
snc4onnx \
--input_onnx_file_paths NonMaxSuppression11.onnx nms_yolact_edge_score_indices.onnx \
--srcop_destop workaround_mul_out selected_indices_before_slice boxes_var gat_boxes_var \
--op_prefixes_after_merging fnms snms \
--output_onnx_file_path NonMaxSuppression11.onnx
############ proto squeeze
OP=Squeeze
LOWEROP=${OP,,}
NUM_BATCHES=1
H=138
W=138
OPSET=11
sog4onnx \
--op_type ${OP} \
--opset ${OPSET} \
--op_name ${LOWEROP}${OPSET}_proto \
--input_variables squeeze_proto_var float32 [${NUM_BATCHES},${H},${W},32] \
--output_variables squeeze_proto_out float32 [${H},${W},32] \
--attributes axes int64 [0] \
--output_onnx_file_path ${OP}${OPSET}_proto.onnx
onnxsim ${OP}${OPSET}_proto.onnx ${OP}${OPSET}_proto.onnx
############ Base model proto + proto squeeze
snc4onnx \
--input_onnx_file_paths yolact_edge_mobilenetv2_54_800000.onnx Squeeze11_proto.onnx \
--srcop_destop proto squeeze_proto_var \
--output_onnx_file_path yolact_edge_mobilenetv2_54_800000.onnx
onnxsim yolact_edge_mobilenetv2_54_800000.onnx yolact_edge_mobilenetv2_54_800000.onnx
############ Base model + NMS
snc4onnx \
--input_onnx_file_paths yolact_edge_mobilenetv2_54_800000.onnx NonMaxSuppression11.onnx \
--srcop_destop boxes fnms_boxes_var scores fnms_scores_var masks snms_gat_masks_var \
--output_onnx_file_path yolact_edge_mobilenetv2_54_800000.onnx
onnxsim yolact_edge_mobilenetv2_54_800000.onnx yolact_edge_mobilenetv2_54_800000.onnx
############ snms_gat_masks_out squeeze
OP=Squeeze
LOWEROP=${OP,,}
NUM_BATCHES=1
OPSET=11
sog4onnx \
--op_type ${OP} \
--opset ${OPSET} \
--op_name ${LOWEROP}${OPSET}_snms_squeeze_masks_out \
--input_variables squeeze_snms_squeeze_masks_out_var float32 [${NUM_BATCHES},\'N\',32] \
--output_variables squeeze_snms_squeeze_masks_out float32 [\'N\',32] \
--attributes axes int64 [0] \
--output_onnx_file_path ${OP}${OPSET}_snms_squeeze_masks_out.onnx
onnxsim ${OP}${OPSET}_snms_squeeze_masks_out.onnx ${OP}${OPSET}_snms_squeeze_masks_out.onnx
############ Base model proto + proto squeeze
snc4onnx \
--input_onnx_file_paths yolact_edge_mobilenetv2_54_800000.onnx Squeeze11_snms_squeeze_masks_out.onnx \
--srcop_destop snms_gat_masks_out squeeze_snms_squeeze_masks_out_var \
--output_onnx_file_path yolact_edge_mobilenetv2_54_800000.onnx
onnxsim yolact_edge_mobilenetv2_54_800000.onnx yolact_edge_mobilenetv2_54_800000.onnx
############ Score gather
python nms_yolact_edge_score_gather_nd.py
python -m tf2onnx.convert \
--opset 11 \
--tflite saved_model_postprocess/nms_yolact_edge_score_gather_nd.tflite \
--output nms_yolact_edge_score_gather_nd.onnx
onnxsim nms_yolact_edge_score_gather_nd.onnx nms_yolact_edge_score_gather_nd.onnx
onnxsim nms_yolact_edge_score_gather_nd.onnx nms_yolact_edge_score_gather_nd.onnx
sor4onnx \
--input_onnx_file_path nms_yolact_edge_score_gather_nd.onnx \
--old_new "input_1" "score_gather_nd_input" \
--output_onnx_file_path nms_yolact_edge_score_gather_nd.onnx \
--mode inputs
sor4onnx \
--input_onnx_file_path nms_yolact_edge_score_gather_nd.onnx \
--old_new "input_2" "score_gather_nd_indices" \
--output_onnx_file_path nms_yolact_edge_score_gather_nd.onnx \
--mode inputs
sor4onnx \
--input_onnx_file_path nms_yolact_edge_score_gather_nd.onnx \
--old_new "Identity" "final_scores" \
--output_onnx_file_path nms_yolact_edge_score_gather_nd.onnx \
--mode outputs
############ Base model + Score gather
snc4onnx \
--input_onnx_file_paths yolact_edge_mobilenetv2_54_800000.onnx nms_yolact_edge_score_gather_nd.onnx \
--srcop_destop scores score_gather_nd_input fnms_selected_indices score_gather_nd_indices \
--output_onnx_file_path yolact_edge_mobilenetv2_54_800000.onnx
onnxsim yolact_edge_mobilenetv2_54_800000.onnx yolact_edge_mobilenetv2_54_800000.onnx
############ Base model 3 outputs concat
OP=Concat
LOWEROP=${OP,,}
NUM_BATCHES=1
OPSET=11
sog4onnx \
--op_type ${OP} \
--opset ${OPSET} \
--op_name ${LOWEROP}${OPSET}_final_concat \
--input_variables cfinal_boxes float32 [${NUM_BATCHES},\'N\',4] \
--input_variables cfinal_scores float32 [${NUM_BATCHES},\'N\',1] \
--input_variables cfinal_classes float32 [${NUM_BATCHES},\'N\',1] \
--output_variables x1y1x2y2_score_class float32 [${NUM_BATCHES},\'N\',6] \
--attributes axis int64 2 \
--output_onnx_file_path ${OP}${OPSET}_final_concat.onnx
onnxsim ${OP}${OPSET}_final_concat.onnx ${OP}${OPSET}_final_concat.onnx
############ Base model + Final concat
snc4onnx \
--input_onnx_file_paths yolact_edge_mobilenetv2_54_800000.onnx Concat11_final_concat.onnx \
--srcop_destop snms_gat_boxes_out cfinal_boxes final_scores cfinal_scores snms_classes_sliced cfinal_classes \
--output_onnx_file_path yolact_edge_mobilenetv2_54_800000.onnx
onnxsim yolact_edge_mobilenetv2_54_800000.onnx yolact_edge_mobilenetv2_54_800000.onnx
############ Mask Transpose
sog4onnx \
--op_type Transpose \
--opset 11 \
--op_name mask_transpose \
--input_variables mask_trans_input float32 [\'N\',32] \
--output_variables mask_trans_output float32 [32,\'N\'] \
--attributes perm int64 [1,0] \
--output_onnx_file_path Transpose11_mask_transpose.onnx
############ Base model + Mask Transpose
snc4onnx \
--input_onnx_file_paths yolact_edge_mobilenetv2_54_800000.onnx Transpose11_mask_transpose.onnx \
--srcop_destop squeeze_snms_squeeze_masks_out mask_trans_input \
--output_onnx_file_path yolact_edge_mobilenetv2_54_800000.onnx
onnxsim yolact_edge_mobilenetv2_54_800000.onnx yolact_edge_mobilenetv2_54_800000.onnx
############ Mask MatMul
sog4onnx \
--op_type MatMul \
--opset 11 \
--op_name mask_matmul \
--input_variables mask_matmul_input_a float32 [138,138,32] \
--input_variables mask_matmul_input_b float32 [32,\'N\'] \
--output_variables mask_matmul_output float32 [138,138,\'N\'] \
--output_onnx_file_path MatMul11_mask_matmul.onnx
onnxsim MatMul11_mask_matmul.onnx MatMul11_mask_matmul.onnx
############ Base model + Mask MatMul
snc4onnx \
--input_onnx_file_paths yolact_edge_mobilenetv2_54_800000.onnx MatMul11_mask_matmul.onnx \
--srcop_destop squeeze_proto_out mask_matmul_input_a mask_trans_output mask_matmul_input_b \
--output_onnx_file_path yolact_edge_mobilenetv2_54_800000.onnx
onnxsim yolact_edge_mobilenetv2_54_800000.onnx yolact_edge_mobilenetv2_54_800000.onnx
############ Mask Sigmoid
sog4onnx \
--op_type Sigmoid \
--opset 11 \
--op_name mask_sigmoid \
--input_variables mask_sig_input float32 [138,138,\'N\'] \
--output_variables mask_sig_output float32 [138,138,\'N\'] \
--output_onnx_file_path Sigmoid11_mask_sigmoid.onnx
onnxsim Sigmoid11_mask_sigmoid.onnx Sigmoid11_mask_sigmoid.onnx
############ Base model + Mask Sigmoid
snc4onnx \
--input_onnx_file_paths yolact_edge_mobilenetv2_54_800000.onnx Sigmoid11_mask_sigmoid.onnx \
--srcop_destop mask_matmul_output mask_sig_input \
--output_onnx_file_path yolact_edge_mobilenetv2_54_800000.onnx
onnxsim yolact_edge_mobilenetv2_54_800000.onnx yolact_edge_mobilenetv2_54_800000.onnx
############ Mask Final Transpose
sog4onnx \
--op_type Transpose \
--opset 11 \
--op_name mask_final_transpose \
--input_variables mask_final_trans_input float32 [138,138,\'N\'] \
--output_variables final_masks float32 [\'N\',138,138] \
--attributes perm int64 [2,0,1] \
--output_onnx_file_path Transpose11_mask_final_transpose.onnx
############ Base model + Mask Final Transpose
snc4onnx \
--input_onnx_file_paths yolact_edge_mobilenetv2_54_800000.onnx Transpose11_mask_final_transpose.onnx \
--srcop_destop mask_sig_output mask_final_trans_input \
--output_onnx_file_path yolact_edge_mobilenetv2_54_800000.onnx
onnxsim yolact_edge_mobilenetv2_54_800000.onnx yolact_edge_mobilenetv2_54_800000.onnx