22
33This doc introduces how to convert your pytorch model into onnx, and how to run an onnxruntime demo to verify your convertion.
44
5- ### Download ONNX models.
5+ ### Step1: Install onnxruntime
6+
7+ run the following command to install onnxruntime:
8+ ``` shell
9+ pip install onnxruntime
10+ ```
11+
12+ ### Step2: Get ONNX models
13+
14+ Users might download our pre-generated ONNX models or convert their own models to ONNX.
15+
16+ #### Download ONNX models.
617
718| Model | Parameters | GFLOPs | Test Size | mAP | Weights |
819| :------| :----: | :----: | :---: | :---: | :---: |
@@ -14,8 +25,7 @@ This doc introduces how to convert your pytorch model into onnx, and how to run
1425| YOLOX-Darknet53| 63.72M | 185.3 | 640x640 | 48.0 | [ github] ( https://github.com/Megvii-BaseDetection/YOLOX/releases/download/0.1.1rc0/yolox_darknet.onnx ) |
1526| YOLOX-X | 99.1M | 281.9 | 640x640 | 51.5 | [ github] ( https://github.com/Megvii-BaseDetection/YOLOX/releases/download/0.1.1rc0/yolox_x.onnx ) |
1627
17-
18- ### Convert Your Model to ONNX
28+ #### Convert Your Model to ONNX
1929
2030First, you should move to <YOLOX_HOME> by:
2131``` shell
3848 dummy_input = torch.randn(1 , 3 , exp.test_size[0 ], exp.test_size[1 ])
3949 ```
4050
41- 2 . Convert a standard YOLOX model by - f. When using - f, the above command is equivalent to:
51+ 1 . Convert a standard YOLOX model by - f. When using - f, the above command is equivalent to:
4252
4353```shell
4454python3 tools/ export_onnx.py -- output- name yolox_s.onnx - f exps/ default/ yolox_s.py - c yolox_s.pth
@@ -50,7 +60,7 @@ python3 tools/export_onnx.py --output-name yolox_s.onnx -f exps/default/yolox_s.
5060python3 tools/export_onnx.py --output-name your_yolox.onnx -f exps/your_dir/your_yolox.py -c your_yolox.pth
5161```
5262
53- ### ONNXRuntime Demo
63+ ### Step3: ONNXRuntime Demo
5464
5565Step1.
5666``` shell
0 commit comments