The conversion part is based on this python project.
Microsoft ONNX runtime is only compatible with old ONNX formats, as described here. The runtime 1.17.1 is compatible with opset 20 and IR 9. So the process also requires a setp to adjust the file format.
pip install openvino2onnx
pip install openvino==2023.3.0
pip install torchvision
python3 -m openvino2onnx 'face-detection-0200.xml'
This will create a .onnx
file in the folder where the script is executed from.
The script can sometimes generate multiple models that needs to be merge. A script will directly be provided in the console output. Copy and run it if needed.
# input, output, version
python3 ir_version_converter.py 'face-detection-0200_composed.onnx' ./test.onnx --target_ir_version 9
If the opset needs to be converted, a script also exists:
# input, version, output
python3 version_converter.py 'face-detection-0200_composed.onnx 20' ./test.onnx