Build a Raspberry Pi AI Camera: On-Device 25 TOPS Object Detection with the Sixfab AI HAT+ (2026)

Sixfab Engineering Team • 2 Oct 2026
General
sixfab raspberry pi ai camera focus

TL;DR

Not the Raspberry Pi AI Camera. This build pairs a Raspberry Pi 5 and the Sixfab AI HAT+ with a standard Camera Module 3. The Raspberry Pi AI Camera (IMX500) is a separate product. See how the two compare.

ResultLive object detection from a camera, on-device, no cloud
ComputeRaspberry Pi 5 + Sixfab AI HAT+ (DEEPX DX-M1M, up to 25 TOPS INT8)
CameraRaspberry Pi Camera Module 3 (Sony IMX708, 12 MP)
ModelYOLOv8n with PPU (yolov8n_ppu.dxnn); the non-PPU model measures within about 1%
Measured end-to-end speed18.6 FPS Raspberry Pi 5, averaged over 855 frames. See the benchmark section.
NPU speed434 FPSYOLOv8n at 640×640 in the DEEPX model zoo. NPU only, not end-to-end on a Raspberry Pi.
YOLOv8 object detection with bounding boxes running on a Raspberry Pi 5 with the Sixfab AI HAT+
The YOLOv8 demo from this build’s repository, running on a video file. The FPS counter in the corner varies from frame to frame and is not the benchmark result below.

What do you need to build an AI vision camera on Raspberry Pi 5?

For this build, you need a Raspberry Pi 5, the Sixfab AI HAT+, a camera, a microSD card, a power supply and cooling. The Pi 5 with 8 GB of RAM is the recommended configuration.

PartSpecPriceLink
Raspberry Pi 58 GB recommended$175 Raspberry Pi
Sixfab AI HAT+DEEPX DX-M1M, up to 25 TOPS, 2 GB NPU memory$95 Sixfab · EU shop
Sixfab AI HAT+ (lower cost option)DEEPX DX-M1ML, up to 13 TOPS, 1 GB NPU memory, listed for single-camera, single-model use. Listed as available by early 2027$63 Sixfab
CameraRaspberry Pi Camera Module 3 (Sony IMX708, 12 MP). Check that you have a Pi 5 camera cableFrom $25 Raspberry Pi
Power supplyRaspberry Pi 27W USB-C Power Supply$12 Raspberry Pi
microSD cardOfficial Raspberry Pi SD Card, 32 GB$24.95 Raspberry Pi
Active Cooler (optional)The AI HAT+ ships with a passive cooler. The Pi 5 Active Cooler is listed as optional$5 Raspberry Pi
Case (optional)Raspberry Pi Case for Raspberry Pi 5, with integrated fan. Mounting a HAT needs stand-offs and GPIO header extenders (not included)$10 Raspberry Pi
Total25 TOPS build, excluding optional cooler and caseApprox. $331.95

The AI HAT+ box contains the board, a 16-pin PCIe FFC cable, a 16 mm 2×20 stacking header, four M2.5 x 16 mm spacers, eight M2.5 x 5 mm screws and a passive cooler with a thermal pad. It works with the Raspberry Pi 5 only.

A USB webcam also works. Camera Modules connect through libcamera; USB cameras connect through V4L2. This guide uses the Raspberry Pi Camera Module 3, and the USB path is covered in Use a USB webcam instead.

How do you assemble the AI vision camera?

Assemble in this order: power off, fit the cooler to the AI HAT+, connect the camera, mount the AI HAT+ on the Pi 5, then power on. Assembly takes a few minutes and needs no soldering.

Power off first. The AI HAT+ does not support hot-plugging. Shut down and unplug the Pi 5 before you mount it.

1
Power offPower off and unplug the Pi 5.
2
Fit the cooler to the AI HAT+Fit the passive cooler to the AI HAT+ before mounting the board.
3
Connect the cameraAttach the Raspberry Pi Camera Module 3.
4
Attach the AI HAT+Mount the AI HAT+ on the Pi 5 using the stacking header, spacers, screws and PCIe FFC cable from the box.
5
Insert and powerInsert the microSD card and connect power.
Sixfab AI HAT+ with the DEEPX DX-M1M chip mounted on a Raspberry Pi 5

How do you install the software?

Flash Raspberry Pi OS 64-bit, add the Sixfab APT repository, install sixfab-dx, and confirm the NPU is detected. The AI HAT+ lists Raspberry Pi OS (Trixie) as its supported host OS.

1

Flash and update Raspberry Pi OS

Use the Raspberry Pi Imager to flash Raspberry Pi OS 64-bit (Trixie) to the microSD card, or use a card with the OS preinstalled. After first boot:

sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential cmake git python3 python3-pip python3-dev python3-venv curl
2

Add the Sixfab APT repository

sudo apt update && sudo apt install apt-repo-sixfab

If apt reports Unable to locate package apt-repo-sixfab, download and install the package directly:

wget https://github.com/sixfab/sixfab_dx/releases/download/v0.1/apt-repo-sixfab.deb
sudo dpkg -i apt-repo-sixfab.deb
3

Install the runtime

sudo apt update && sudo apt install sixfab-dx

This installs the DEEPX runtime, the Python wheels and a pre-configured virtual environment at /opt/sixfab-dx/venv.

4

PCIe Gen 3 (nothing to do on the AI HAT+)

With the Sixfab AI HAT+, PCIe Gen 3 is enabled automatically through the HAT+ EEPROM. You do not need to edit config.txt.

Using a different M.2 setup? Enable Gen 3 manually.

If your DX-M1 is not on an AI HAT+, add these two lines to /boot/firmware/config.txt and reboot:

dtparam=pciex1
dtparam=pciex1_gen=3
5

Verify the NPU

dxrt-cli -s

Expected output:

pi@pi:~ $ dxrt-cli -s
DXRT v3.x.x
=======================================================
 * Device 0: M1M, Accelerator type
---------------------   Version   ---------------------
 * RT Driver version   : v2.x.x
 * PCIe Driver version : v2.x.x
-------------------------------------------------------
 * FW version          : v2.x.x
--------------------- Device Info ---------------------
 * Memory : LPDDR4 4200 Mbps, 1.92GiB
 * Board  : M.2, Rev 0.0
 * Chip Offset : 1
 * PCIe   : Gen3 X1 [01:00:00]
NPU 0: voltage 750 mV, clock 1000 MHz, temperature 37'C
NPU 1: voltage 750 mV, clock 1000 MHz, temperature 37'C
NPU 2: voltage 750 mV, clock 1000 MHz, temperature 37'C
=======================================================
6

Check the camera

rpicam-hello --list-cameras

If nothing is listed, jump to Troubleshooting.

7

Get the code and models

git clone https://github.com/sixfab/sixfab-dx-examples.git
cd sixfab-dx-examples
./auto-install.sh
source /opt/sixfab-dx/venv/bin/activate

auto-install.sh checks that the runtime works, downloads models and sample media from the GitHub release into resources/, installs the Python dependencies and builds the C++ demos. Run source /opt/sixfab-dx/venv/bin/activate at the start of every new session.

How do you run object detection on the camera?

Set the input source to rpicam and run the YOLOv8 demo. Install the camera library first if it is missing:

sudo apt install -y python3-picamera2

Edit python_examples/config.yml:

global:
  input_source: "rpicam"
  show_fps: true
  confidence_threshold: 0.5
  iou_threshold: 0.45
demos:
  yolov8:
    model_path: "../resources/models/YoloV8N.dxnn"

Launch the demo menu and pick YOLOv8:

bash python_examples/start.sh
DEEPX Python demo launcher in a terminal, listing the available demos
The demo launcher. The header in this screenshot shows a video file as the input source.

Expected result: a window with live video, bounding boxes with class labels, and an FPS counter.

DEEPX demo window showing bounding boxes labelled person and skis, with an FPS counter in the top-left corner
The detection window. This screenshot was captured on a video file, so its FPS counter is not the camera benchmark.

Run the C++ version

The C++ demo takes the camera as a flag, in index:width:height:fps format:

./cpp_examples/build/object_detection/yolov8_demo --source libcamera --path 0:1280:720:30

Without a path, it defaults to 1536×864 at 30 fps. If you see libcamera support not compiled in, rebuild with libcamera enabled:

cd cpp_examples/build
cmake .. -DENABLE_LIBCAMERA=ON && make -j$(nproc)

Use a USB webcam instead

Set input_source: "webcam" and webcam_index: 0 in config.yml. If the camera is not found, run ls /dev/video* and try index 1 or 2.

How fast is a Raspberry Pi 5 AI vision camera with the Sixfab AI HAT+?

This build reaches 18.6 FPS end to end with YOLOv8n in our measurement. The NPU alone can run YOLOv8n at 434 FPS in DEEPX’s own test, but a single camera stream reaches a fraction of that, because capture, CPU pre- and post-processing, drawing and display all take time on every frame. Both numbers matter, so this section shows both and labels each.

18.6 FPSMeasured end to end on this Raspberry Pi 5 camera build
434 FPSYOLOv8n NPU-only figure from the DEEPX model zoo
855Frames measured in the camera benchmark
53.8 msOverall measured time per frame

NPU FPS from the DEEPX model zoo

These are NPU FPS figures, not end-to-end FPS on a Raspberry Pi. DEEPX measured them on a DX-M1 M.2 module in a desktop host (Intel Core i5-14600K, 32 GB RAM) with dx-com v2.4.0 and dx-rt v3.4.0, using dxrun -m <MODEL_FILE> --use-ort -t 5 -b. DEEPX notes that results vary with hardware configuration. Source: DEEPX model zoo

ModelInputNPU FPS (DEEPX model zoo)
YOLOv8n (YOLOV8N-1)640×640434
YOLOv8n, PPU (YOLOV8N-2)640×640190
YOLOv5s (YOLOV5S-1)640×640324
YOLOv5s, PPU (YOLOV5S-12)640×640426
YOLO11n (YOLOV11N-1)640×640391
YOLOv10n (YOLOV10N-1)640×640358
YOLO26n (yolo26n-1)640×640321
SCRFD-500M, face detection (SCRFD500M-1)640×640544

What a Raspberry Pi 5 reaches

Sixfab’s own benchmark on a Raspberry Pi 5 (8 GB) with the 25 TOPS DX-M1M measured both views on the same models. The NPU-only figure is the async throughput with 8 requests in flight. The end-to-end figure is a single request, from video decode to parsed output.

ModelNPU-only (async) FPSEnd-to-end (single stream) FPS
YOLO26n178.713.7
YOLOv8l50.111.2

Source: Raspberry Pi 5 AI HAT benchmark: DEEPX vs Hailo , DEEPX SDK 3.3.2, 640×640 input, one video clip.

Two things follow. First, the Pi 5 NPU result for YOLO26n (178.7) sits below the model zoo figure for the same model (321), as expected for a different host and link. Second, end-to-end numbers for a single stream land in the teens, not in the hundreds. The measurement on this build, below, is 18.6 FPS.

Measured on this build

On a Raspberry Pi 5 with the Sixfab AI HAT+ and a Camera Module 3, YOLOv8n with PPU support runs at 18.6 FPS end to end, averaged over 855 frames in 45.9 seconds. The same model without PPU support measures within about 1% of that.

ModelEnd-to-end FPS
YOLOv8n with PPU (yolov8n_ppu.dxnn)18.6
YOLOv8n without PPUwithin about 1% of 18.6

The demo times each step of the pipeline. The table below is the summary it printed for the PPU run:

Pipeline stepAverage latencyThroughput
Read6.37 ms156.9 FPS
Preprocess2.29 ms436.2 FPS
Inference20.20 ms49.5 FPS
Postprocess0.04 ms27,642.4 FPS
Render3.15 ms317.8 FPS
Display21.62 ms46.3 FPS
Overall53.8 ms per frame18.6 FPS

The steps run one after another for each frame, so their latencies add up: 53.7 ms across the six steps, in line with the 53.8 ms measured overall, which is 18.6 FPS. Display (21.62 ms) and Inference (20.20 ms) are the two largest steps. The Inference step times one frame at a time, so it is not comparable with the model zoo’s NPU throughput figure, which keeps the NPU busy with queued requests.

Methodology: Raspberry Pi 5, Sixfab AI HAT+ (DX-M1M), Camera Module 3, 855 frames in 45.9 seconds, per-step timing from the demo’s built-in performance summary.

Another measured data point from the repository

On 2026-10-06, the pose-estimation app’s engine (yolov8n-pose.dxnn) was benchmarked headless on a Raspberry Pi 5 (Debian 13, Python 3.13.5, DEEPX DX-M1M, DXRT v3.4.2) against video clips. The full loop reached 32.1 to 32.3 FPS on a 1920×1080 clip with about 4 people per frame, and 36.0 to 37.6 FPS on an 898×506 clip. Each figure is the range over three runs, after 30 warm-up frames and 300 timed frames. Live camera capture was not part of that test, and it is a pose model, not YOLOv8n detection.

Troubleshooting

dxrt-cli -s does not list the NPU

Check whether the kernel module loaded, then look at the driver log and the runtime service:

lsmod | grep dx
dmesg | grep -i dx
sudo journalctl -u dxrtd

If the module is missing, try sudo modprobe dx_npu. Power off and check that the PCIe FFC cable is seated, since the HAT+ does not support hot-plugging.

The camera is not found
ls /dev/video*
rpicam-hello --list-cameras

For a Camera Module, enable the interface in sudo raspi-config. For a USB webcam, change webcam_index in config.yml.

ImportError: No module named 'dxrt'

The Sixfab virtual environment is not active. Run source /opt/sixfab-dx/venv/bin/activate, or start through start.sh, which activates it for you.

auto-install.sh says the DEEPX NPU runtime is not installed

Install sixfab-dx with the APT steps above before running auto-install.sh. The script does not install the runtime itself.

Unable to locate package apt-repo-sixfab

Install the package from the .deb file shown in Step 2, then run sudo apt update again.

libcamera support not compiled in (C++ demos)

Rebuild with -DENABLE_LIBCAMERA=ON, as shown above. This needs OpenCV built with GStreamer.

A demo shows a red dot in the launcher

The model file is missing at the configured path. Check ls -lah models/ and fix model_path in config.yml.

FPS is lower than the model zoo numbers

That is expected: the model zoo figures are NPU-only. For end-to-end speed, try a PPU model variant of whichever model you use, for example yolov11n-ppu instead of yolov11n. PPU variants move part of the CPU workload onto the NPU, which leaves the CPU more headroom. The gain depends on the model: on YOLOv8n the end-to-end difference is about 1%, while the other models we tested run noticeably faster. Also close other processes and use the async demo.

If FPS drops during long runs, check the NPU temperature. Thermal throttling starts once the NPU reaches 80 °C, and FPS drops from that point on. Run dxrt-cli -s to read the current temperature of each NPU. With the passive cooler included in the AI HAT+ box, we saw no thermal throttling, even on the heaviest models we tested.

What can you build next?

Count people

Count people with a heatmap: the retail-analytics app in the same repo.

Pose estimation

Detect falls and coach exercise from the camera: the pose-estimation app.

Run a full NVR

Run a full NVR with alerts: the Frigate-based projects in sixfab-dx-frigate (doorbell, porch pirate, bird ID).

Pose estimation demo: skeleton overlay on people in a Pilates studio, running on the Sixfab AI HAT+
The YOLO Pose demo from the same repository.

Frequently asked questions

What is an AI vision camera on Raspberry Pi 5?

It is a Raspberry Pi 5 with a camera and an AI accelerator that runs neural network models on the device. In this build, the accelerator is the Sixfab AI HAT+ with a DEEPX DX-M1 NPU rated at up to 25 TOPS, and the camera is a Camera Module 3. It is not the Raspberry Pi AI Camera (IMX500), which runs models on the camera sensor itself.

How much does this build cost?

The Sixfab AI HAT+ costs $95 for the 25 TOPS version and $63 for the 13 TOPS version. With Raspberry Pi list prices for the other parts, the 25 TOPS build is approximately $331.95 excluding the optional Active Cooler and case.

Does this build need the internet?

No. Inference runs on the NPU in the HAT, so detection works offline. The internet is only needed for the one-time install and model download.

Do I need to enable PCIe Gen 3 on the Sixfab AI HAT+?

No. The AI HAT+ enables PCIe Gen 3 automatically through its HAT+ EEPROM. Manual config.txt changes are only needed for other M.2 setups.

Which camera works with the Sixfab AI HAT+?

The repository supports Raspberry Pi Camera Modules through libcamera, USB webcams, video files, single images and RTSP streams. This guide was built and measured with the Raspberry Pi Camera Module 3.

How fast is YOLOv8n on a Raspberry Pi 5 with the Sixfab AI HAT+?

On a Raspberry Pi 5 with the Sixfab AI HAT+ and a Camera Module 3, YOLOv8n runs at 18.6 FPS end to end, including capture, preprocessing, inference, postprocessing, drawing and display. The DEEPX model zoo lists 434 FPS for YOLOv8n at 640×640, which is NPU-only and not end-to-end on a Raspberry Pi.

What is the difference between the 13 TOPS and 25 TOPS AI HAT+?

Both are the same board with a different DEEPX chip: the DX-M1ML (13 TOPS, 1 GB NPU memory) for single-camera, single-model use, and the DX-M1M (25 TOPS, 2 GB NPU memory) for multi-model or multi-camera use. The 13 TOPS version is listed as available by early 2027.

Can I run other models, such as pose estimation or segmentation?

Yes. The same repository has 28 Python demos and 26 C++ demos, covering object detection, pose estimation, segmentation, classification and face detection.

How is this different from the Raspberry Pi AI Camera (IMX500)?

The Raspberry Pi AI Camera runs a small neural network on the camera sensor itself, while this build runs the model on an external NPU, the Sixfab AI HAT+, and works with any camera. They solve different problems, so the right choice depends on your model size and your camera.

Raspberry Pi AI Camera (IMX500)Raspberry Pi 5 + Sixfab AI HAT+ (this build)
Where the model runsOn the Sony IMX500 sensor inside the cameraOn the DEEPX DX-M1 NPU on the HAT+, over PCIe
Model memoryAbout 8 MB, shared with firmware and working memory2 GB NPU memory (DX-M1M, 25 TOPS); 1 GB on the 13 TOPS version
PrecisionINT8INT8
CameraThe IMX500 module only (12.3 MP)Camera Module 3, USB webcams, RTSP streams or video files
Compatible hostsRaspberry Pi models with a CSI portRaspberry Pi 5 only
Price$70$95 for the 25 TOPS HAT+, plus a camera
Model workflowConvert and package with Sony’s tools; the packaging step runs on a Raspberry PiCompile ONNX models to DXNN with DX-COM; the repository ships ready-to-run models

The IMX500 keeps its firmware, model and working memory inside about 8 MB, so it suits compact networks. A hands-on review lists input sizes of up to 640×640, and as low as 224×224 for heavier networks. The HAT+ has its own 2 GB of NPU memory, so models are not held to that 8 MB budget, and this build runs YOLOv8n at 640×640.

We do not compare frame rates head to head, because the two use different models and pipelines. Raspberry Pi’s documentation does not publish IMX500 inference benchmarks, and independent testing reports MobileNet SSD and PoseNet running at around 30 fps. For this build, YOLOv8n at 640×640 measures 18.6 FPS end to end, including display, and 434 FPS NPU-only in the DEEPX model zoo.

Choose the IMX500 if you want the smallest setup: one $70 module, a compact model such as MobileNet SSD, and any Raspberry Pi with a CSI port.

Choose the Sixfab AI HAT+ if you need YOLO-class models at 640×640, larger or multiple models, or your own camera source such as a USB webcam or an RTSP stream.

Build it on the Pi 5

The code, runtime, models, documentation and measured performance data for this build are all linked above.

Get the example code →   |   View the Sixfab AI HAT+ →