MODNet/demo/image_matting/Inference_with_ONNX
Zhanghan Ke ba4356109b Revert "Update README.md"
This reverts commit b9e3dddc86.
2021-02-18 13:35:16 +08:00
..
README.md Revert "Update README.md" 2021-02-18 13:35:16 +08:00
export_modnet_onnx.py Inference with onnx 2021-02-18 13:34:27 +08:00
inference_onnx.py Revert "Colab demo is added" 2021-02-18 13:35:16 +08:00
requirements.txt Inference with onnx 2021-02-18 13:34:27 +08:00

README.md

Inference with onnxruntime

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