# Darknet/YOLO: the C and CUDA detection framework that moved to Codeberg

> Darknet is an open source neural network framework for YOLO object detection, now at version 5.1 "Moonlit" and mirrored from Codeberg to GitHub. It suits teams that want a small C/C++ inference and training binary rather than a Python stack, and it is the wrong choice for anyone who wants a managed training pipeline.

**hank-ai/darknet** — Darknet/YOLO object detection framework

- Repository: https://github.com/hank-ai/darknet
- Website: https://www.ccoderun.ca/darknet/
- Stars: 854 · Forks: 112
- Language: C++
- License: Apache-2.0
- Published: 2026-09-10 · Updated: 2026-09-10 · Language: en
- Canonical page: https://hysenlabs.com/projects/hank-ai-darknet

## What Darknet/YOLO solves, and who it is actually for

Darknet is a neural network framework written in C, C++, and CUDA, and YOLO is the real-time object detection system that runs inside it. The project's own framing is that it is both faster and more accurate than other frameworks and versions of YOLO, and that it is free and open source, including for commercial products, with no fee and no license required beyond the Apache-2.0 terms in the repository.

The audience is narrower than the download numbers suggest. This is for engineers who want a compiled binary that reads a frame, resizes it, and runs detection, rather than a Python process with a deep dependency tree. The README states the CPU build runs on Raspberry Pi, cloud and Colab servers, desktops, laptops, and high-end training rigs, while the GPU build needs either a CUDA-capable NVIDIA GPU or a ROCm-capable AMD GPU. If your deployment target is a small edge board with no Python runtime, that sentence is the whole pitch.

The second audience is people who already have weights and a cfg file and want to run them. The README notes that people are generally expected to train their own network, but that pre-trained weights exist for convenience when first installing the software, including People-R-People (2 classes, person and head) and MSCOCO (80 classes).

## How the framework is put together: CMake, cfg files and a versioned CLI

The repository layout tells you most of the architecture. There is a CMakeLists.txt at the top level with a set of included fragments: CM_dependencies.cmake, CM_misc.cmake, CM_package.cmake, CM_source.cmake, and CM_version.cmake. Source is split by role rather than by module: src-lib/ for the library, src-cli/ for the command line tool, src-examples/ for sample applications, src-onnx/ for the ONNX export tool, src-python/ and src-test/ for bindings and tests.

Network definitions live in cfg/, which is the part most users touch. A detection run is therefore a binary plus a weights file plus a cfg file, with no Python import step in between.

The version history explains why the CLI changed shape. The original Darknet by Joseph Redmon had no version number and is treated as 0.x; the Alexey Bochkovskiy repository is treated as 1.x; the Hank.ai sponsored repository maintained by Stéphane Charette starting in 2023 was the first with a version command, returning 2.x "OAK". Version 3.x "JAZZ" removed many old and unmaintained commands, and the README points anyone who needs them at a checkout of the v2 branch. Version 4.x "SLATE" added AMD ROCm support and replaced all printf() and std::cout calls so log messages can be redirected. Version 5.x "Moonlit" moved the repository to Codeberg, added OpenBLAS for CPU-only builds, Profile-Guided Optimization, experimental ONNX export, and incomplete Java bindings. v5.1 rewrote the mAP function and extended the ONNX export tool to include the nodes needed to export both confs and boxes.

That is a real API break, not a cosmetic one. The README states the legacy C API was modified and applications using the original Darknet API need minor modifications, with a new C and C++ API documented on the project site.

## Building Darknet/YOLO with CMake on Linux

The README documents one unified CMake build for Windows, Linux, and Mac, plus separate instructions for Google Colab, WSL, and Docker. The repository also ships build_ubuntu.sh and build_windows.cmd at the top level for the common cases, and the Linux CMake method is one of the documented build paths.

Once it builds, the first thing to run is the version command, because the README is explicit that the command's output is how you tell the generations apart:

```bash
darknet version
```

The README states that this returns 5.x "Moonlit" on the current release, and that v5.1 is the most recent release, dated December 2025. If it prints 2.x, you checked out the v2 branch rather than master.

To run detection without training anything, start from pre-trained weights. The README lists People-R-People (2 classes, person and head) and MSCOCO (80 classes including person, backpack, chair, and clock) as the two main sets, with LEGO Gears and Rolodex as additional datasets and weights for testing. The repository also has a colab/ directory for the Google Colab path, which is the quickest way to see the tool work before you commit to a local build. The README does not give a copy-paste detection command with concrete arguments, so the weights and cfg sections are where to look for the file names to pass.

## Where Darknet/YOLO gets in your way

The first limitation is geographic, and it is the one most likely to bite a new user. The README states that in August 2025 the repository moved to Codeberg.org/CCodeRun/darknet, and that all commits are automatically mirrored from Codeberg to the older Hank.ai GitHub repository. The GitHub repository is not archived and its last push was on 2026-08-30, but a mirror is a mirror: the README directs help requests to the Darknet/YOLO Discord server and the Darknet/YOLO FAQ, not to GitHub issues. If your team's workflow assumes pull requests and issue threads on GitHub, you are working against the project's stated arrangement.

The second limitation is the API churn. Going from 2.x to 3.x removed many old and unmaintained commands, and the legacy C API was modified. The README's own remedy for a missing command is to check out the previous v2 branch, which means an application pinned to old behaviour cannot simply move forward. Upgrading is a porting exercise with a documented migration page, not a version bump.

The third is the training assumption. The README says people are generally expected to train their own network, and pre-trained weights are described as convenient for testing rather than as a supported product. There is no hosted training service, no dataset versioning, and no experiment tracking in this repository.

Finally, the newest pieces are explicitly unfinished. ONNX export is marked experimental, and the Java language bindings are marked incomplete and in-progress. The README also notes that ROCm support still needs MIOpen added. Anyone planning production use of those three features is building on a stated gap.

## Darknet/YOLO versus a Python detection stack

The natural alternative for most teams is a Python framework such as PyTorch with a detection library on top. The difference is not accuracy, it is where the work happens. A Python stack gives you a training loop you can modify in a notebook, a large ecosystem of model zoos and export tools, and debugging through the interpreter. Darknet gives you a compiled binary, a cfg file per network, and a C and C++ API for embedding detection in an application that has no Python runtime.

That trade cuts both ways. In Darknet, changing the network topology means editing a cfg file and rebuilding rather than subclassing a module. Adding a custom loss means editing C++ in src-lib/ rather than writing a Python function. For a team already fluent in C++ and shipping a native application, that is a smaller gap than it sounds. For a research team iterating on architectures weekly, it is a much larger one.

The ONNX export path is the bridge the project is building, and its status matters. The README describes it as experimental, and states that in v5.1 the export tool now includes the necessary nodes to export both confs and boxes. That is enough to move a trained model out of Darknet, but the experimental label means you should treat the exporter as something to verify on your own network rather than a guaranteed interchange format.

## Licence and the cost of keeping up

The repository is Apache-2.0, and the README states you can incorporate Darknet/YOLO into existing projects and products, including commercial ones, without a license or paying a fee. Pre-trained weights are described as trained by someone else and made available for free on the internet. That covers the framework. It does not tell you the provenance or the licence terms of any individual weights file you download, and the README does not discuss that question, so treat weight licensing as something to check separately for your use case.

On maintenance cost, the version cadence is the thing to plan around. The README describes 2.x "OAK" from 2023 into late 2024, 3.x "JAZZ" in October 2024, 4.x "SLATE" in early 2025, 5.x "Moonlit" in August 2025, and v5.1 in December 2025. That is a major version roughly every few months, and the 3.x release removed commands. Budget for a re-read of the migration notes at each step rather than assuming the build will carry forward unchanged. The repository also carries README_CMake_flags.md, README_GPU_AMD_ROCM.md, README_GPU_NVIDIA_CUDA.md, and README_PGO.md, which is where the build-flag surface is documented; those files are the ones to diff when a build that worked stops working.

## Conclusion

Adopt Darknet/YOLO if you need a self-contained C/C++ detector you can embed and build with CMake on Linux, Windows or Mac, and if you can train or source your own weights. Do not adopt it if you want a managed training service, a Python-first API, or a project whose issues and pull requests live on GitHub, since the README states development moved to Codeberg in August 2025 and GitHub only receives a mirror. Before committing, run the version command to confirm you built v5.1 "Moonlit" rather than an older v2 branch, and check the legacy C API notes at the project's API page if you are porting an existing application.

## FAQ

### What is Darknet/YOLO?

It is an open source neural network framework written in C, C++, and CUDA, with YOLO as the real-time object detection system that runs inside it. The repository is Apache-2.0 and the README states it can be used in commercial products without a fee.

### What is the Darknet framework used for?

The README describes it as a framework for running YOLO object detection, with a CPU build that runs on Raspberry Pi, cloud and Colab servers, desktops, and laptops, and a GPU build that requires an NVIDIA CUDA or AMD ROCm capable GPU. It supports both inference and training.

### What is Darknet-53?

The README does not describe Darknet-53, so this question cannot be answered from the repository documentation.

### What is Darknet used for?

The README presents Darknet/YOLO as a real-time object detection system written in C, C++, and CUDA, used for both running detection on images and video and for training networks from datasets. It is known to work on Linux, Windows, and Mac.

### What is Darknet?

In this repository, Darknet is an open source neural network framework written in C, C++, and CUDA, with YOLO as the object detection system that runs inside it. The version command reports which generation you built, currently 5.x "Moonlit".

## Sources

- [hank-ai/darknet on GitHub](https://github.com/hank-ai/darknet)
- [License: Apache-2.0](https://github.com/hank-ai/darknet/blob/master/LICENSE)
- [Project website](https://www.ccoderun.ca/darknet/)
- [README](https://github.com/hank-ai/darknet/blob/master/README.md)
- [Releases](https://github.com/hank-ai/darknet/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/hank-ai-darknet
