Example of performing inference with ultralytics YOLOv5 using the 2022.1.0 openvino API in C++ using Docker as well as python.
This repository is only for model inference using openvino. Therefore, it assumes the YOLOv5 model is already trained and exported to openvino (.bin, .xml) format. For further info check YOLOv5.
This repository folder contains the Dockerfile to build a docker image with the Intel® Distribution of OpenVINO™ toolkit.
- This command builds an image with OpenVINO™ 2022.1.0 release.
docker build cpp -t openvino_container:2022.1.0
- This command creates a docker container with OpenVINO™ 2022.1.0 release.
docker run -it --rm -v %cd%:/yolov5-openvino openvino_container:2022.1.0
docker run -it --rm -v $(pwd):/yolov5-openvino openvino_container:2022.1.0
From within the docker run:
cd cpp && mkdir build && cd build
Then create the make file using cmake:
cmake -S ../ -O ./
Then compile the program using:
make
Then run the executable:
./main
python -m venv /path/to/env
source /path/to/env/bin/activate # Linux/mac
\path\to\env\Script\activate # Windows
cd python
pip install -r requirements.txt
Then run the script:
python main.py