Forked from branch https://github.com/ayermolo/darkflow.git to support YoloV4 pb and onnx file generation from weights. Take a look of this master branch of darknet for YoloV4 Updates. More variants of YoloV4 weights
Python3.6.1, tensorflow 1.14, numpy, opencv 3, tf2onnx 1.6 version branch 1000b66
-
Get yolov4.cfg - 245 MB: yolov4.weights (Google-drive mirror yolov4.weights ) paper Yolo v4 just change
width=andheight=parameters inyolov4.cfgfile and use the sameyolov4.weightsfile for all cases. -
Modify darkflow\darkflow\utils\loader.py
- Change line 121 self.offset = 16 to self.offset = 20
-
Run python flow --model
path of yolov4.cfg file--loadpath of yolov4 weights--savepb- python36 flow --model
cfg/yolov4.cfg--load..\weights\yolov4.weights--savepb
- python36 flow --model
-
Run python -m tf2onnx.convert --input
Frozen pb file--outputOnnx file name--inputsInput node--outputsOutput nodes--verbose --opsetOpset number- python36 -m tf2onnx.convert --input
yolov4.pb--outputyolo_v4.onnx--inputsinput:0--outputsBiasAdd_93:0,BiasAdd_101:0,BiasAdd_109:0--verbose --opset10
- python36 -m tf2onnx.convert --input
-
Updated ONNX file to have a custom Op as last node for YoloV4 post processing. For Reference see update_onnx_model.py. For more details on Operations used, check https://github.com/onnx/onnx/blob/master/docs/PythonAPIOverview.md