Are you sure you want to delete this access key?
This doc introduces how to convert your pytorch model into onnx, and how to run an onnxruntime demo to verify your convertion.
Model | Parameters | GFLOPs | Test Size | mAP | Weights |
---|---|---|---|---|---|
YOLOX-Nano | 0.91M | 1.08 | 416x416 | 25.8 | github |
YOLOX-Tiny | 5.06M | 6.45 | 416x416 | 32.8 | github |
YOLOX-S | 9.0M | 26.8 | 640x640 | 40.5 | github |
YOLOX-M | 25.3M | 73.8 | 640x640 | 47.2 | github |
YOLOX-L | 54.2M | 155.6 | 640x640 | 50.1 | github |
YOLOX-Darknet53 | 63.72M | 185.3 | 640x640 | 48.0 | github |
YOLOX-X | 99.1M | 281.9 | 640x640 | 51.5 | github |
First, you should move to <YOLOX_HOME> by:
cd <YOLOX_HOME>
Then, you can:
python3 tools/export_onnx.py --output-name yolox_s.onnx -n yolox-s -c yolox_s.pth
Notes:
-n: specify a model name. The model name must be one of the [yolox-s,m,l,x and yolox-nano, yolox-tiny, yolov3]
-c: the model you have trained
-o: opset version, default 11. However, if you will further convert your onnx model to OpenVINO, please specify the opset version to 10.
--no-onnxsim: disable onnxsim
To customize an input shape for onnx model, modify the following code in tools/export.py:
dummy_input = torch.randn(1, 3, exp.test_size[0], exp.test_size[1])
python3 tools/export_onnx.py --output-name yolox_s.onnx -f exps/default/yolox_s.py -c yolox_s.pth
python3 tools/export_onnx.py --output-name your_yolox.onnx -f exps/your_dir/your_yolox.py -c your_yolox.pth
Step1.
cd <YOLOX_HOME>/demo/ONNXRuntime
Step2.
python3 onnx_inference.py -m <ONNX_MODEL_PATH> -i <IMAGE_PATH> -o <OUTPUT_DIR> -s 0.3 --input_shape 640,640
Notes:
Press p or to see the previous file or, n or to see the next file
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?