This is tensorrt c++ api implementation of yolov5.
- yolov5 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 yolov5s6 yolov5s6.cfg yolov5s6.weights yolov5m6 yolov5m6.cfg yolov5m6.weights yolov5l6 yolov5l6.cfg yolov5l6.weights yolov56 yolov5x6.cfg yolov5x.6weights 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