Skip to content

Latest commit

 

History

History
 
 

torch2trt

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

English | 简体中文

Overall process

1.Pytorch->TensorRT

python export.py --weights "torch's path" --onnx2trt  --fp16_trt 

2.TensorRT inference

python torch2trt/main.py --trt_path "trt's path"

Image preprocessing -> TensorRT inference -> visualization

Time-consuming comparison

Backbone Pytorch(ms) TensorRT_FP16(ms)
yolov5n-0.5 7.7 2.1
yolov5n-face 7.7 2.4
yolov5s-face 5.6 2.2
yolov5m-face 9.9 3.3
yolov5l-face 15.9 4.5

Pytorch=1.10.0+cu102 TensorRT=8.2.0.6 Hardware=rtx2080ti

python torch2trt/speed.py --torch_path "torch's path" --trt_path "trt's path"

Visualization

yolov5n-0.5 yolov5n-face
yolov5s-face yolov5m-face yolov5l-face