YOLOv11n inference for the Raspberry Pi 5, fully optimized with ARM NEON intrinsics and shipped as a single prebuilt library — plus the official Python (ultralytics) implementation as a reference.
The C version runs the full 24-layer network on data/dog.jpg (768×576) in ~310 ms — about 1.4× faster than the Python version on the same Pi, with identical detections.
Beyond being faster, the C implementation has a very different runtime profile to the Python one:
lib/libyolov11n.so; the demo CLI is a tiny program using the public API in inc/yolov11n.h.Both implementations share the same yolo11n.pt weights (COCO, 80 classes) and produce identical detections.
Measured on a Raspberry Pi 5 (Cortex-A76, 4 cores, aarch64) with data/dog.jpg (768×576),
conf=0.25, iou=0.45. Numbers are the median of 15 interleaved runs.
| Implementation | Total time (ms) | Detections |
|---|---|---|
| C (ARM NEON) | ~309 | 4 |
| Python (ultralytics) | ~429 | 4 |
Both implementations produce the same detections on data/dog.jpg:
C (NEON): Python (ultralytics):
bicycle: 0.937 [128,136,567,419] dog: 0.921 [132,221,310,540]
dog: 0.930 [132,221,310,540] bicycle: 0.914 [129,137,565,418]
truck: 0.501 [469,74,691,173] truck: 0.499 [470,75,692,171]
car: 0.490 [471,74,692,172] car: 0.458 [471,75,693,171]
ultralytics — only for the Python reference./run.sh # build CLI & run C on data/dog.jpg -> output.jpg
./run.sh --py # run the Python (ultralytics) version -> output_org.jpg
./run.sh data/bus.jpg out.jpg 0.3 0.5 # pick image / thresholds
./run.sh --bench # benchmark C vs Python on data/dog.jpg
The first time you run the Python version, ultralytics downloads yolo11n.pt if it is missing.
# Build the CLI demo against lib/libyolov11n.so -> build/yolov11
cmake -S . -B build && cmake --build build -j$(nproc)
# Run (usage: yolov11 <input> [output] [conf] [iou])
./build/yolov11 data/dog.jpg # -> output.jpg
./build/yolov11 data/dog.jpg out.jpg 0.25 0.45
# Python reference (usage: predict.py <input> [output] [conf] [iou])
python3 python/predict.py data/dog.jpg # -> output_org.jpg
yolov11n_raspberry_pi/
├── run.sh # Quick build & run script (C or --py, --bench)
├── CMakeLists.txt # Builds the demo CLI against the prebuilt library
├── README.md # This file
├── LICENSE # MIT License
├── lib/
│ └── libyolov11n.so # Prebuilt inference engine (ARM NEON, ~100-frame trial)
├── inc/
│ └── yolov11n.h # Public API (only header needed to use the library)
├── src/
│ └── main.c # Demo CLI using the public API
├── python/
│ ├── predict.py # Official ultralytics reference
│ └── benchmark.py # C vs Python benchmark
└── data/
├── dog.jpg / bus.jpg # Sample images
└── coco_names.txt # COCO class names
The model weights are embedded inside lib/libyolov11n.so, so no weight files are needed.
The optimized inference source code is not distributed — it lives only in the compiled library.
MIT — see LICENSE. Research/educational use only. The prebuilt library is covered by the 100-frame evaluation trial described above.
1 commits
C++
74.4%
C
23.2%
Python
1.5%
YOLOv11n inference for the Raspberry Pi 5, fully optimized with ARM NEON intrinsics and shipped as a single prebuilt library — plus the official Python (ultralytics) implementation as a reference.
The C version runs the full 24-layer network on data/dog.jpg (768×576) in ~310 ms — about 1.4× faster than the Python version on the same Pi, with identical detections.
Beyond being faster, the C implementation has a very different runtime profile to the Python one:
lib/libyolov11n.so; the demo CLI is a tiny program using the public API in inc/yolov11n.h.Both implementations share the same yolo11n.pt weights (COCO, 80 classes) and produce identical detections.
Measured on a Raspberry Pi 5 (Cortex-A76, 4 cores, aarch64) with data/dog.jpg (768×576),
conf=0.25, iou=0.45. Numbers are the median of 15 interleaved runs.
| Implementation | Total time (ms) | Detections |
|---|---|---|
| C (ARM NEON) | ~309 | 4 |
| Python (ultralytics) | ~429 | 4 |
Both implementations produce the same detections on data/dog.jpg:
C (NEON): Python (ultralytics):
bicycle: 0.937 [128,136,567,419] dog: 0.921 [132,221,310,540]
dog: 0.930 [132,221,310,540] bicycle: 0.914 [129,137,565,418]
truck: 0.501 [469,74,691,173] truck: 0.499 [470,75,692,171]
car: 0.490 [471,74,692,172] car: 0.458 [471,75,693,171]
ultralytics — only for the Python reference./run.sh # build CLI & run C on data/dog.jpg -> output.jpg
./run.sh --py # run the Python (ultralytics) version -> output_org.jpg
./run.sh data/bus.jpg out.jpg 0.3 0.5 # pick image / thresholds
./run.sh --bench # benchmark C vs Python on data/dog.jpg
The first time you run the Python version, ultralytics downloads yolo11n.pt if it is missing.
# Build the CLI demo against lib/libyolov11n.so -> build/yolov11
cmake -S . -B build && cmake --build build -j$(nproc)
# Run (usage: yolov11 <input> [output] [conf] [iou])
./build/yolov11 data/dog.jpg # -> output.jpg
./build/yolov11 data/dog.jpg out.jpg 0.25 0.45
# Python reference (usage: predict.py <input> [output] [conf] [iou])
python3 python/predict.py data/dog.jpg # -> output_org.jpg
yolov11n_raspberry_pi/
├── run.sh # Quick build & run script (C or --py, --bench)
├── CMakeLists.txt # Builds the demo CLI against the prebuilt library
├── README.md # This file
├── LICENSE # MIT License
├── lib/
│ └── libyolov11n.so # Prebuilt inference engine (ARM NEON, ~100-frame trial)
├── inc/
│ └── yolov11n.h # Public API (only header needed to use the library)
├── src/
│ └── main.c # Demo CLI using the public API
├── python/
│ ├── predict.py # Official ultralytics reference
│ └── benchmark.py # C vs Python benchmark
└── data/
├── dog.jpg / bus.jpg # Sample images
└── coco_names.txt # COCO class names
The model weights are embedded inside lib/libyolov11n.so, so no weight files are needed.
The optimized inference source code is not distributed — it lives only in the compiled library.
MIT — see LICENSE. Research/educational use only. The prebuilt library is covered by the 100-frame evaluation trial described above.
1 commits
C++
74.4%
C
23.2%
Python
1.5%