Article Directory
First introduce the software and hardware version configuration
OpenVINO 2020.4 version
CPU :Intel® Core™ i7-10750H CPU @ 2.60GHz
GPU: Intel® UHD Graphics driver: 27.20.100.8783
Models: Darknet YOLOv3 YOLOv4-tiny and PyTorch YOLOv5 v1.0
Model conversion process: Darknet→TensorFlow→OpenVINO
Model conversion process: PyTorch→ONNX→OpenVINO
1. Brief process
1. Install OpenVINO (not written in many online tutorials, pay attention to install the default path)
2. Model conversion (currently OpenVINO only supports opset 10)
-
(1) First, you need to prepare your own model. .weights is converted to .pb and .pt is converted to .onnx for backup.
-
(2) OpenVINO model conversion (take yolov5s as an example)
The model conversion script is in the local directory:
C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\model_optimizer
Conversion command:
python mo.py --input_model yolov5s.onnx --output_dir ./output --input_shape [1,3,640,640] --data_type FP16
After success, you can see that bin and xml files are generated under the model output path:
3. Inference test
Initialize environment
C:\"Program Files (x86)"\IntelSWTools\openvino\bin\setupvars.bat
The official provides some demos, run the inference script, select the corresponding demo, and also have python api;
C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\inference_engine\demos
Of course, my reasoning using yolov5 failed here, mainly for post-processing issues, which need to be studied; the general process is like this.
2. YOLOv3
OpenVINO CPU推理速度:
硬件:Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
模型:YOLOv3 416*416
FPS:2.5
耗时:360ms左右
Attached is a picture of OpenVINO's inference: It
means that OpenCV DNN is not as fast as OpenCV DNN on the CPU, and it ran roughly for about 300ms.
OpenVINO 核显推理速度:
硬件:Intel(R) UHD Graphics
模型:YOLOv3 416*416
FPS:3.4
耗时:295ms左右
3. YOLOv4-tiny
OpenVINO CPU推理速度:
硬件:Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
模型:YOLOv4-tiny 416*416
FPS:19
耗时:52ms左右
OpenVINO 核显推理速度:
硬件:Intel(R) UHD Graphics
模型:YOLOv4-tiny 416*416
FPS:20
耗时:49.5ms左右
Four. Conclusion
The acceleration effect of OpenVINO is not obvious on the computer CPU, maybe the acceleration effect on Inter's VPU is okay; here yolov5 v1.0 is overturned, the main v5 version is more, the activation function is also different; if necessary, you can refer to the following project v5 If the v2.0 version is converted to OpenVINO test v5 v3.0, you need to check the official website to modify the source code to convert the model.
yolov5 v2.0 OpenVINO
https://github.com/anhnktp/yolov5_openvino