This is a C++ demo for running YOLO object detection using LibTorch.
This loads the best.torchscript model(which is from best.pt).
It outputs the detected bounding boxes as "output.jpg" in the current directory.
- Clone this repository and navigate to the project directory.
- Make sure to have OpenCV installed in the system
- Download libtorch from the official PyTorch website and extract it at the top directory of this project.
- Build the project using CMake:
mkdir build cd build cmake .. make - Run the demo:
./yolov8_libtorch_inference