MODNet/demo/image_matting/Inference_with_ONNX
manthandrive01 74a874e357 Update README.md 2021-02-12 00:03:21 +05:30
..
README.md Update README.md 2021-02-12 00:03:21 +05:30
export_modnet_onnx.py Inference with onnx 2021-02-11 23:52:28 +05:30
inference_onnx.py Inference with onnx 2021-02-11 23:52:28 +05:30
requirements.txt Inference with onnx 2021-02-11 23:52:28 +05:30

README.md

Inference with onnxruntime

Download modnet.onnx

1. Export onnx model

Run the following command:

python export_modnet_onnx.py \
    --ckpt-path=pretrained/modnet_photographic_portrait_matting.ckpt \
    --output-path=modnet.onnx

2. Inference

Run the following command:

python inference_onnx.py \
    --image-path=PATH_TO_IMAGE \
    --output-path=matte.png \
    --model-path=modnet.onnx