Export MODNet to ONNX format
masterTo convert a PyTorch checkpoint to an ONNX model, run the onnx.export_onnx module. Note that a higher version of PyTorch than the official MODNet (which uses torch==1.7.1) is recommended for this export function.
python -m onnx.export_onnx \
--ckpt-path=pretrained/modnet_photographic_portrait_matting.ckpt \
--output-path=pretrained/modnet_photographic_portrait_matting.onnx