Raspberry Pi Vision Deployment
Raspberry Pi runs vision on ARM CPUs with camera connectors, so small counts and gates work offline for tens of dollars.
Why Does This Exist?
Not every camera needs a GPU. A door counter, a shelf gap check, or a parking gate sees one slow scene and must cost under $100 installed. A Jetson at $249 plus power is overkill. Raspberry Pi 5 exists for that tier: a Broadcom BCM2712 with 4 Cortex A76 cores at 2.4 GHz, VideoCore VII, up to 16 GB LPDDR4X, two 4 lane MIPI camera ports, and PCIe, in production until at least 2036.
The catch is CPU only inference. No CUDA, no tensor cores. Models must be small, integer, and threaded. Edge deployment decides Pi versus GPU edge. Inference optimization trims the graph first. ONNX carries the portable graph to the Pi runtime.
Basics first: frames arrive through libcamera into zero copy buffers. The model reads RGB at a fixed size, say 224 by 224, and returns labels or boxes. Power comes from USB C at 5 volts and 5 amps with the 27 watt supply, or USB peripherals throttle to 600 mA.
Think of It Like This
A corner shop till, not a supermarket checkout
A corner shop does not need twenty lanes. One till, one queue, one person counting change slowly but correctly keeps the shop open all day on little power.
Pi is the corner till. One camera, one model, a few frames per second, always on. The analogy stops at rushes: shop tills queue people politely, while Pi queues frames by dropping them, so budgets must name what drops first.
How It Actually Works
Pick the Pi 5 with 8 GB for vision: 4 GB swaps under parallel camera plus model load, while 8 GB holds frame pools plus an INT8 runtime comfortably. Fit the official active cooler or a large heatsink, since sustained loads push 12 watts peak and the board throttles near 80 C. Use the 27 watt USB C supply, or high power USB cameras brown out under load.
Thread for throughput. A MobileNetV2 224 INT8 runs about 210 ms single thread on A76. Four threads with XNNPACK bring it near 80 ms, a 2.6 times gain, because convolutions split across cores while memory stays shared. Set intra op threads to 4 and inter op to 1 for single stream cameras. Larger detectors like YOLO miss real time on Pi CPU and belong on GPU edge.
Input size is the lever. Halving width and height quarters math: 320 to 160 cuts 4 times the MACs. Counting doors at 192 pixels often matches 320 pixel accuracy within a point while doubling fps.
Worked counter math
Single thread 210 ms is 4.76 fps since 1000 divided by 210 equals 4.76. Four threads at 80 ms is 12.5 fps since 1000 divided by 80 equals 12.5, a 2.63 times gain since 210 divided by 80 equals 2.63. At 12 watts that is 1.04 fps per watt since 12.5 divided by 12 equals 1.04. Model file falls 14 MB FP32 to 3.5 MB INT8, 4 times smaller since 14 divided by 3.5 equals 4.
Code
The point is the thread and size check before mounting the Pi. It recomputes fps, gain, and size from two latency numbers.
import numpy as np
def fps(latency_ms: float) -> float: return 1000.0 / latency_ms # frames per second
def size_after_int8(mb_fp32: float) -> float: return mb_fp32 / 4.0 # INT8 is one byte vs four
print(fps(210.0)) # -> 4.761904761904762print(fps(80.0)) # -> 12.5print(210.0 / 80.0) # -> 2.625print(size_after_int8(14.0)) # -> 3.5Measure with locked governor and cooler fitted. Without cooling the 80 ms number drifts past 120 ms in ten minutes.
Watch Out For
USB power that throttles the camera, not the model
A phone charger at 5 volts and 3 amps limits Pi 5 USB to 600 mA by default. The symptom is a model that benchmarks fine while the camera disconnects under load. Fix it by using the 27 watt supply so the firmware raises the limit to 1.6 amps, and by powering cameras through a hub on long runs.
Heat that quietly halves fps
A bare Pi 5 in a sealed ceiling box hits 80 C and throttles from 2.4 GHz toward 1.5 GHz. The symptom is 12.5 fps at install and 7 fps a week later. Fix it with the active cooler, vents, and an alert on vcgencmd get_throttled plus throttle minutes per day.
The Quick Version
- Pi 5 gives 4 Cortex A76 at 2.4 GHz with camera ports for CPU only vision under $100.
- Thread 4 ways for single stream cameras and keep input small, since size quarters math.
- Our frame fell 210 ms to 80 ms, 4.8 to 12.5 fps, 2.63 times faster.
- That is 1.04 fps per watt at 12 watts with cooling fitted.
- Use the 27 watt supply and watch throttle flags, or power and heat will decide fps for you.