Porting YOLO to TensorFlow, weights and all
Darkflow translates darknet's YOLO into TensorFlow so you can load pre-trained weights, retrain, and export frozen graphs to mobile devices.

What it does Darkflow is a TensorFlow adaptation of the YOLO real-time object-detection network originally built in darknet. It lets you load existing YOLO weights, fine-tune on your own dataset, or train from scratch entirely within the TensorFlow ecosystem. Once you’re happy with the model, it exports a frozen protobuf graph plus a metadata JSON file that can be dropped into mobile apps or C++ pipelines.
The interesting bit
The project handles the awkward weight-format translation for you: it can load darknet .weights files, compare layer shapes against a new config, and reuse every identical layer while randomly initializing only the mismatched ones. It also bundles post-processing metadata—anchors, labels, thresholds—into a .meta file alongside the .pb graph so your mobile build doesn’t need to drag the original .cfg around.
Key highlights
- Loads YOLO v1 and v2 weights directly from darknet binaries
- Supports transfer learning by reusing matching layers across different model configs
- Exports frozen TensorFlow protobuf graphs for Java, C++, or Objective-C++ deployment
- Offers a Python API (
TFNet) and JSON output with bounding-box coordinates and confidence scores - Runs real-time detection on images, video files, or webcam streams
Caveats
- Explicitly targets TensorFlow 1.0, which is several major versions behind current releases
- The maintainer is actively looking for help, so expect some issue-tracker dust
- Mobile export instructions reference TensorFlow C++ API docs from the r0.9 era
Verdict A practical stopgap if you need to migrate legacy YOLO v1/v2 weights into TensorFlow or ship frozen graphs to mobile. Otherwise, the documented dependency on TensorFlow 1.0 and YOLO v2 suggests most new projects will want a more current stack.
Frequently asked
- What is thtrieu/darkflow?
- Darkflow translates darknet's YOLO into TensorFlow so you can load pre-trained weights, retrain, and export frozen graphs to mobile devices.
- Is darkflow open source?
- Yes — thtrieu/darkflow is open source, released under the GPL-3.0 license.
- What language is darkflow written in?
- thtrieu/darkflow is primarily written in Python.
- How popular is darkflow?
- thtrieu/darkflow has 6.1k stars on GitHub.
- Where can I find darkflow?
- thtrieu/darkflow is on GitHub at https://github.com/thtrieu/darkflow.