Darknet/YOLO v5.0-117-g31c55275-dirty
Object Detection Framework
 
Loading...
Searching...
No Matches
darknet_onnx.cpp File Reference

Convert Darknet/YOLO .cfg and .weights files to .onnx files. More...

Include dependency graph for darknet_onnx.cpp:

Detailed Description

Convert Darknet/YOLO .cfg and .weights files to .onnx files.

Warning
This code should not be trusted. It was written in the summer of 2025 by Stephane Charette without a full understanding of either the Darknet/YOLO internals, nor any reasonable understanding of the ONNX internals. I obtained some sample .onnx files from several sources on the web, and attempted to reverse engineer how these .onnx files may have (!?) been put together from Darknet/YOLO weights. I appologize for the cases where things are not yet working as expected, and if it does happen to work I regret to say it is likely a mix of luck and happy coincidences.

Over time, I'm hoping other people will show up to help shine light in the dark corners, or provide me with more configurations and weights that are broken to help make this tool work better. As you'll no doubt see in the code below, there are many places where I've left some "todo" comments in an attempt to document code that needs to be fixed.

Stephane Charette, 2025-08-18.