Skip to content

based on CaoWGG/TensorRT-YOLOv4, this branch made few changes to support tensorrt-7.1.0, cuda-10.2 and cudnn-8.0, which runs on a tx2 board with jetpack4.4dp installed.

Notifications You must be signed in to change notification settings

rui-shen-afk/tensorrt-yolov4

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TensorRT-YOLOv4 For TensorRT-7.1.0

Performance

Model Input Size GPU Mode Inference Time / FPS
YOLOv4 608x608 gtx 1080Ti float32 23.3 ms
YOLOv4 416x416 gtx 1080Ti float32 13.0 ms
YOLOv3 608x608 gtx 1080Ti float32 18.2 ms
YOLOv3 416x416 gtx 1080Ti float32 10.0 ms
YOLOv3-Tiny 608x608 gtx 1080Ti float32 3.31 ms
YOLOv3-Tiny 416x416 gtx 1080Ti float32 2.01 ms
YOLOv3-Tiny-Prn 608x608 gtx 1080Ti float32 3.05 ms
YOLOv3-Tiny-Prn 416x416 gtx 1080Ti float32 2.01 ms
YOLOv3 608x608 TX2 MAXN float16 6 FPS
YOLOv4 416x416 TX2 MAXN float16 7 FPS
  • Note that including pre-processing and post-processing time.

Enviroments

  • Jetson TX2
Ubuntu 18.04
TensorRT 7.1.0
CUDA 10.2
cuDNN 8.0.0
onnx 1.4.1
OpenCV 4.1.1
CMake 3.10.2

Models

  • Modify [net] and [yolo] segments of yolovx.cfg.
[net]
batch=1
subdivisions=8
width=416
height=416
...

[yolo]
mask = 0,1,2
anchors = ...
down_stride = 8
classes=80
infer_thresh = 0.25
num=9
jitter=.3
ignore_thresh = .7
truth_thresh = 1
scale_x_y = 1.2
iou_thresh=0.213
...

[yolo]
mask = 3,4,5
anchors = ...
down_stride = 16
infer_thresh = 0.25
classes=80
num=9
jitter=.3
ignore_thresh = .7
truth_thresh = 1
scale_x_y = 1.1
iou_thresh=0.213
...

[yolo]
mask = 6,7,8
anchors = ...
classes=80
down_stride = 32
infer_thresh = 0.25
num=9
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1
scale_x_y = 1.05
iou_thresh=0.213
...
  • Convert darknet yolo to onnx.
python3 tools/yolo_to_onnx.py --cfg model/yolov4.cfg --weights model/yolov4.weights --out model/yolov4.onnx

Example

git clone https://github.com/hlld/tensorrt-yolov4.git
cd tensorrt-yolov4
mkdir build
cd build && cmake .. && make
cd ..

## YOLOv3
./buildEngine -i model/yolov3.onnx -o model/yolov3.engine -b 1 -m 0
./runDet -i model/yolov3.engine -p dog.jpg -v nuscenes_mini.mp4
### use web camera.
./videoDet -e model/yolov3.engine -c 1

## YOLOv4
./buildEngine -i model/yolov4.onnx -o model/yolov4.engine -b 1 -m 0
./runDet -i model/yolov4.engine -p dog.jpg -v nuscenes_mini.mp4
### use web camera.
./videoDet -e model/yolov4.engine -c 1

Related projects

About

based on CaoWGG/TensorRT-YOLOv4, this branch made few changes to support tensorrt-7.1.0, cuda-10.2 and cudnn-8.0, which runs on a tx2 board with jetpack4.4dp installed.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 77.1%
  • Python 9.6%
  • Cuda 7.7%
  • CMake 3.1%
  • SWIG 1.0%
  • C 0.9%
  • Dockerfile 0.6%