1--完整项目
完整项目地址:https://github.com/liujf69/TensorRT-Demo
git clone https://github.com/liujf69/TensorRT-Demo.git
cd TRT_YoloV8
2--模型转换
cd yolov8
python gen_wts.py
3--编译项目
mkdir build
cd build
cmake .. # 需要更改 CMakeLists.txt
make
4--序列化模型
./yolov8 -s ../yolov8/weights/yolov8s.wts ./yolov8s.engine s
5--推理测试
# 推理图片
./yolov8 -d ./yolov8s.engine -i ../images g
# 推理视频
./yolov8 -d ./yolov8s.engine -v ../videos/test1.avi g