Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 1.02 KB

File metadata and controls

27 lines (18 loc) · 1.02 KB

YOLOv4 conversion to ONNX and TensorRT

References

Many thanks for great job for jkjung-avt and his tensorrt_demos repository, originally published with MIT License.

YOLOv4 -> ONNX

python yolo_to_onnx.py -c 80 -m ./yolov4 -o ./yolov4.onnx

ONNX -> TensorRT

# convert ONNX to tensorrt engine with float32 weights
python onnx_to_tensorrt.py -v -c 80 -m ./yolov4.onnx -q fp32 -o ./yolov4-fp32.trt

# convert ONNX to tensorrt engine with float16 weights
python onnx_to_tensorrt.py -v -c 80 -m ./yolov4.onnx -q fp16 -o ./yolov4-fp16.trt

# convert ONNX to tensorrt engine with int8 weights
# needs path to calibration dataset (representative images from dataset), marked below as './calib_images' 
python onnx_to_tensorrt.py -v -c 80 -m ./yolov4.onnx -i ./calib_images -q int8 -o ./yolov4-int8.trt