Skip to content

Commit

Permalink
we need remove Mod Xor Not op inside onnx
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Apr 21, 2022
1 parent aad609b commit 5884822
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions export_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ def vis_res_fast(res, img, colors):

def get_model_infos(config_file):
if "sparse_inst" in config_file:
# output_names = ["masks", "scores", "labels"]
output_names = ["masks", "scores"]
output_names = ["masks", "scores", "labels"]
# output_names = ["masks", "scores"]
input_names = ["images"]
dynamic_axes = {"images": {0: "batch"}}
return input_names, output_names, dynamic_axes
Expand Down Expand Up @@ -291,7 +291,7 @@ def get_model_infos(config_file):
onnx_f,
input_names=input_names,
output_names=output_names,
opset_version=12,
opset_version=11,
do_constant_folding=True,
verbose=args.verbose,
dynamic_axes=dynamic_axes,
Expand Down
5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ Make sure you have read **rules** before ask me any questions.
3. `SparseInst`:
Sparsinst already supported exporting to onnx!!

```
python export_onnx.py --config-file configs/coco/sparseinst/sparse_inst_r50_giam_aug.yaml --video-input ~/Videos/a.flv --opts MODEL.WEIGHTS weights/sparse_inst_r50_giam_aug_2b7d68.pth INPUT.MIN_SIZE_TEST 512
```
Then you can have `weights/sparse_inst_r50_giam_aug_2b7d68_sim.onnx` generated, this onnx can be inference using ORT without any unsupported ops.



## 🤒️ Performance
Expand Down
2 changes: 1 addition & 1 deletion yolov7/modeling/meta_arch/sparseinst.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,5 +266,5 @@ def inference_onnx(self, output, batched_inputs, max_shape):
# logger.info(f'all_scores: {all_scores.shape}')
# logger.info(f'all_labels: {all_labels.shape}')
logger.info(f'all_masks: {all_masks.shape}')
return all_masks, all_scores
return all_masks, all_scores, all_labels
# return all_masks, all_labels

0 comments on commit 5884822

Please sign in to comment.