This is tensorrt c++ api implementation of yolov5.
- yolov5 n,s,m,l,x
- inequal net input size
- batch inference
- support FP32,FP16,INT8
-
clone the project
git clone https://github.com/ultralytics/yolov5.git git clone https://github.com/enazoe/yolo-tensorrt.git
-
get .cfg and .weights file
copy the script to yolov5 root dir and generate the cfg and weigths file.
cp yolo-tensorrt/scripts/yaml2cfg.py yolov5/ python yaml2cfg.py mv yolov5/models/yolov5.cfg yolo-tensorrt/configs/yolov5-4.0 mv yolov5/weights/yolov5.weights yolo-tensorrt/configs/yolov5-4.0
transformed models
model .cfg .weights yolov5n yolov5n.cfg yolov5n.weights yolov5s yolov5s.cfg yolov5s.weights yolov5m yolov5m.cfg yolov5m.weights yolov5l yolov5l.cfg yolov5l.weights yolov5x yolov5x.cfg yolov5x.weights model .yaml .pt .cfg .weights yolov5s-v4.0 yolov5s.yaml yolov5s.pt yolov5s.cfg yolov5s.weights yolov5m-v4.0 yolov5m.yaml yolov5m.pt yolov5m.cfg yolov5m.weights yolov5l-v4.0 yolov5l.yaml yolov5l.pt yolov5l.cfg yolov5l.weights yolov5x-v4.0 yolov5x.yaml yolov5x.pt yolov5x.cfg yolov5x.weights model .yaml .pt .cfg .weights yolov5s-v3.0 yolov5s.yaml yolov5s.pt yolov5s.cfg yolov5s.weights yolov5m-v3.0 yolov5m.yaml yolov5m.pt yolov5m.cfg yolov5m.weights yolov5l-v3.0 yolov5l.yaml yolov5l.pt yolov5l.cfg yolov5l.weights yolov5x-v3.0 yolov5x.yaml yolov5x.pt yolov5x.cfg yolov5x.weights model .yaml .pt .cfg .weights yolov5s-v2.0 yolov5s.yaml yolov5s.pt yolov5s.cfg yolov5s.weights yolov5m-v2.0 yolov5m.yaml yolov5m.pt yolov5m.cfg yolov5m.weights yolov5l-v2.0 yolov5l.yaml yolov5l.pt yolov5l.cfg yolov5l.weights yolov5x-v2.0 yolov5x.yaml yolov5x.pt yolov5x.cfg yolov5x.weights -
build and run
reference the readme.md
- win10: open sln/sln.sln file using the visual studio 2015
- ubuntu: cmake