YOLOv8 is a state-of-the-art object detector by ultralytics. This project implements the YOLOv8 object detector in C++ with an OpenVINO backend to speed up inference performance.
- Supports both image and video inference.
- Provides faster inference speeds.
Tested on Macbook Pro M1.
- CMake v3.8+ - Download from https://cmake.org/.
- OpenVINO Toolkit 2022.1+ - Tested on version 2023.1.0. Download from here.
- OpenCV v4.6+ - Tested on version v4.8.0_7. Download from here.
-
Set the
OpenCV_DIR
environment variable to point to your../../opencv/build
directory. -
Set the
OpenVINO_DIR
environment variable to point to your../../openvino/runtime/cmake
directory. -
Run the following build commands:
For Mac with VS Developer Command Prompt:
cd <git-directory> # Install dependencies brew install openvino brew install opencv # Build cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release cd build make
-
Export the ONNX file:
pip install ultralytics yolo export model=yolov8s.pt format=onnx # Export official model
-
To run the inference, execute the following command:
yolo --model <MODEL_PATH> [-i <IMAGE_PATH> | -v <VIDEO_PATH>] [--imgsz IMAGE_SIZE] [--gpu] [--iou-thresh IOU_THRESHOLD] [--score-thresh CONFIDENCE_THRESHOLD] # Example: yolo --model yolov8x.onnx -i images/zidane.jpg
This project is licensed under the MIT License. See the LICENSE file for details.
- YOLOv8 by ultralytics: https://github.com/ultralytics/ultralytics
- YOLO-NAS-OpenVino-cpp by Y-T-G: [https://github.com/Y-T-G/YOLO-NAS-OpenVino-cpp]
- OpenVINO: https://github.com/openvinotoolkit/openvino
- OpenCV: https://github.com/opencv/opencv