Skip to content

Latest commit

 

History

History
 
 

Yolov4

YOLOv4 Network darknet=>ONNX=>TensorRT

1.Reference

2. darknet model zoo

model weights
yolov4 weights
yolov4-tiny weights
yolov4x-mish weights
yolov4-csp weights
yolov3 weights
yolov3-spp weights
yolov3-tiny weights

Above in the table are now supported models, for more darknet models, please see the official model zoo.

3.Export ONNX Model

  • export yolov4 onnx
python3 export_onnx.py
  • export yolov4-tiny onnx
python3 export_onnx.py --cfg_file cfg/yolov4-tiny.cfg --weights_file yolov4-tiny.weights --output_file yolov4-tiny.onnx --strides 32 16 --neck FPN
  • export yolov4x-mish, yolov4-csp onnx
python3 export_onnx.py --cfg_file cfg/yolov4x-mish.cfg --weights_file yolov4x-mish.weights --output_file yolov4x-mish.onnx
python3 export_onnx.py --cfg_file cfg/yolov4-csp.cfg --weights_file yolov4-csp.weights --output_file yolov4-csp.onnx
  • export yolov3, yolov3-spp onnx
python3 export_onnx.py --cfg_file cfg/yolov3.cfg --weights_file yolov3.weights --output_file yolov3.onnx --strides 32 16 8 --neck FPN
python3 export_onnx.py --cfg_file cfg/yolov3-spp.cfg --weights_file yolov3-spp.weights --output_file yolov3-spp.onnx --strides 32 16 8 --neck FPN
  • export yolov3-tiny onnx
python3 export_onnx.py --cfg_file cfg/yolov3-tiny.cfg --weights_file yolov3-tiny.weights --output_file yolov3-tiny.onnx --strides 32 16 --neck FPN

4.Build Yolov4_trt Project

mkdir build && cd build
cmake ..
make -j

5.Run Yolov4_trt

  • inference with yolov4
./Yolov4_trt ../config.yaml ../samples
  • inference with yolov4-tiny
./Yolov4_trt ../config-tiny.yaml ../samples
  • inference with yolov4x-mish
./Yolov4_trt ../config-xmish.yaml ../samples

6.Results

For more information, please see this blog: https://blog.csdn.net/linghu8812/article/details/109270320