This tutorial includes a C++ demo for OpenVINO, as well as some converted models.
Main results on COCO-val:
Model | Scale | AP | AP50 | XML |
---|---|---|---|---|
FreeYOLO-Nano | 640 | 30.5 | 50.3 | github |
FreeYOLO-Tiny | 640 | 34.4 | 53.9 | github |
FreeYOLO-Large | 640 | 48.3 | 68.5 | github |
FreeYOLO-Huge | 640 |
Please visit Openvino Homepage for more details.
Option1. Set up the environment tempororally. You need to run this command everytime you start a new shell window.
source /opt/intel/openvino_2021/bin/setupvars.sh
Option2. Set up the environment permenantly.
Step1. For Linux:
vim ~/.bashrc
Step2. Add the following line into your file:
source /opt/intel/openvino_2021/bin/setupvars.sh
Step3. Save and exit the file, then run:
source ~/.bashrc
-
Export ONNX model
Please refer to the ONNX tutorial. Note that you should set --opset to 10, otherwise your next step will fail.
-
Convert ONNX to OpenVINO
cd <INSTSLL_DIR>/openvino_2021/deployment_tools/model_optimizer
Install requirements for convert tool
sudo ./install_prerequisites/install_prerequisites_onnx.sh
Then convert model.
python3 mo.py --input_model <ONNX_MODEL> --input_shape <INPUT_SHAPE> [--data_type FP16]
For example:
python3 mo.py --input_model yolox_tiny.onnx --input_shape [1,3,640,640] --data_type FP16
Make sure the input shape is consistent with those in cpp file.
source /opt/intel/openvino_2021/bin/setupvars.sh
mkdir build
cd build
cmake ..
make
./yolo_free_openvino <XML_MODEL_PATH> <IMAGE_PATH> <DEVICE>