How pjreddie/darknet works
Darknet is a C/CUDA neural-network framework. A typical detection workflow configures a network, loads image data, runs network inference, and produces detections or a visual demo; the framework also supports training and other network tasks. The graph retains major network, data, image, and layer-computation subsystems. Relationships are limited to calls or references visible in excerpts, the source index, or README; unsampled implementation details are not asserted.
Main entry points: network.c Network runtime · parser.c Config parser · convolutional_layer.c Convolution · demo.c Detection demo
Components 19
Configuration and API
- Public API
include/darknet.h - Config parser
src/parser.c - Python interface
python/darknet.py
Data and Images
- Data loading
src/data.c - Image operations
src/image.c
Network Computation
- Network runtime
src/network.c - Layer registry
src/layer.c - Convolution
src/convolutional_layer.c - Connected layers
src/connected_layer.c - Batch normalization
src/batchnorm_layer.c - Detection layers
src/detection_layer.c - Region and YOLO
src/region_layer.c - Recurrent layers
src/rnn_layer.c - Activations
src/activations.c - Tensor operations
src/blas.c - CUDA support
src/cuda.c
Inference and Results
- Box geometry
src/box.c - Detection demo
src/demo.c
Other components
- Framework user
Connections 21
- Framework user → Public API: uses
include/darknet.h - Config parser → Layer registry: constructs layers
src/parser.c - Config parser → Convolution: creates layer
src/parser.c - Config parser → Recurrent layers: creates layer
src/parser.c - Network runtime → Config parser: loads configuration
- Network runtime → Data loading: uses data
src/network.c - Network runtime → Convolution: dispatches layers
src/network.c - Network runtime → Connected layers: dispatches layers
src/network.c - Network runtime → Detection layers: dispatches layers
src/network.c - Network runtime → Region and YOLO: dispatches layers
src/network.c - Convolution → Batch normalization: uses
src/convolutional_layer.c - Convolution → Tensor operations: uses operations
src/convolutional_layer.c - Connected layers → Tensor operations: uses operations
src/connected_layer.c - Detection layers → Tensor operations: uses operations
src/detection_layer.c - Region and YOLO → Box geometry: uses geometry
src/region_layer.c - Data loading → Image operations: uses images
src/data.c - Detection demo → Network runtime: uses runtime
src/demo.c - Detection demo → Detection layers: uses detections
src/demo.c - Detection demo → Image operations: renders results
src/demo.c - Python interface → Public API: wraps API
- Network runtime → CUDA support: GPU execution