ultralytics-ascend/examples/YOLOv8-LibTorch-CPP-Inference
Muhammad Rizwan Munawar f7b9009c91
PyCharm Docs Inspect fixes (#18432)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2024-12-29 19:19:05 +01:00
..
CMakeLists.txt Add YOLOv8 LibTorch C++ inference example (#7090) 2023-12-21 00:47:14 +01:00
main.cc Add BGR to RGB conversion in LibTorch example (#17864) 2024-11-28 22:50:04 +01:00
README.md PyCharm Docs Inspect fixes (#18432) 2024-12-29 19:19:05 +01:00

YOLOv8 LibTorch Inference C++

This example demonstrates how to perform inference using YOLOv8 models in C++ with LibTorch API.

Dependencies

Dependency Version
OpenCV >=4.0.0
C++ Standard >=17
Cmake >=3.18
Libtorch >=1.12.1

Usage

git clone ultralytics
cd ultralytics
pip install .
cd examples/YOLOv8-LibTorch-CPP-Inference

mkdir build
cd build
cmake ..
make
./yolov8_libtorch_inference

Exporting YOLOv8

To export YOLOv8 models:

yolo export model=yolov8s.pt imgsz=640 format=torchscript