GithubHelp home page GithubHelp logo

hlld / tensorrt-yolov4 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from caowgg/tensorrt-yolov4

13.0 0.0 9.0 12.65 MB

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.

CMake 3.11% C++ 77.11% C 0.90% Dockerfile 0.56% Cuda 7.74% SWIG 0.98% Python 9.61%

tensorrt-yolov4's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.