Skip to content

Latest commit

 

History

History

ScaledYOLOv4

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Scaled-YOLOv4 Network PyTorch=>ONNX=>TensorRT

1.Reference

2. Model Zoo

model weights
yolov4-p5 weights
yolov4-p6 weights
yolov4-p7 weights

3.Export ONNX Model

git clone https://github.com/linghu8812/ScaledYOLOv4.git
git fetch origin yolov4-large:yolov4-large
git checkout yolov4-large

copy export_onnx.py into ScaledYOLOv4/models and run export_onnx.py to generate yolov4-p5.onnx and so on.

  • export yolov4-p5 onnx
export PYTHONPATH="$PWD" && python3 models/export_onnx.py --weights ./weights/yolov4-p5.pt --img-size 896
  • export yolov4-p6 onnx
export PYTHONPATH="$PWD" && python3 models/export_onnx.py --weights ./weights/yolov4-p6.pt --img-size 1280
  • export yolov4-p7 onnx
export PYTHONPATH="$PWD" && python3 models/export_onnx.py --weights ./weights/yolov4-p7.pt --img-size 1536

4.Build ScaledYOLOv4_trt Project

cd ../  # in project directory
mkdir build && cd build
cmake ..
make -j

5.Run ScaledYOLOv4_trt

  • inference with yolov4-p5
cd ../../bin/
./tensorrt_inference ScaledYOLOv4 ../configs/ScaledYOLOv4/config-p5.yaml ../samples/detection_segmentation
  • inference with yolov4-p6
cd ../../bin/
./tensorrt_inference ScaledYOLOv4 ../configs/ScaledYOLOv4/config-p6.yaml ../samples/detection_segmentation
  • inference with yolov4-p7
cd ../../bin/
./tensorrt_inference ScaledYOLOv4 ../configs/ScaledYOLOv4/config-p7.yaml ../samples/detection_segmentation

6.Results

  • yolov4-p7 predict result is shown below: