Inside AI
← Build & Hack
Proposed build / Edge AI

Build a workbench object detector

Proposed build · Bring up a local detector, inspect its model settings and score its response to one workbench object.

Device profile · Raspberry Pi AI HAT+ ↗
Start with the documented setup

This is a proposed workflow. Follow the linked official setup, then use the checks below to decide whether it works on your hardware.

Three-quarter view of the green AI HAT+ mounted above a partially transparent Raspberry Pi 5.
The HAT+ sits above the Pi 5. The short orange ribbon joins the accelerator board to the host. Hardware reference for this proposed build; not a result from our test. Raspberry Pi ↗

Difficulty and kit

Intermediate. Gather a Pi 5, the original AI HAT+, a supported camera and cable, a display, adequate cooling and a suitable Pi power supply. Use an ordinary bottle, plain background, desk lamp and a marked camera position. The software guide specifies 64-bit Raspberry Pi OS Trixie and the hailo-all package for this board. Pi software guide

1. Verify the hardware separately

Follow the setup guide and reboot after installing the documented dependencies. Record the Device Architecture from the first command. The second should display a normal camera view for five seconds. A failure at either step is a setup result; correct it before measuring the detector. Pi software guide

hailortcli fw-control identify
rpicam-hello -t 5000

2. Capture the baseline configuration

Read the installed JSON before the run. Record the model filename for your architecture, input dimensions, threshold and temporal settings. Run the 30-second detector with one bottle in view. The expected observation is a labeled box; record what actually appears. Raspberry Pi’s YOLOv8 configuration Pi software guide

config=/usr/share/rpi-camera-assets/hailo_yolov8_inference.json
cat "$config"
rpicam-hello -t 30000 --post-process-file "$config"

3. Score two lighting conditions

Alternate bright and dim trials. Include ten bottle presentations and ten empty-scene controls per condition. A presentation counts as a hit only if a correctly labeled box covers the marked bottle within two seconds. Record misses and any false bottle box during an empty control. The linked experiment describes the latency measurement.

4. Expose detections to your own code

Optional extension. Install the matching Hailo Apps release, then check its full detection example with hailo-detect --input rpi. In a copy of detection.py, replace its callback body with this proposed diagnostic. It prints the frame number and highest bottle score without reading the image pixels. Run the copy as a Python script in the configured Hailo environment. Remove per-frame logging before timing. Hailo’s tracking example Hailo’s Python callback

def app_callback(element, buffer, user_data):
    if buffer is None:
        return
    roi = hailo.get_roi_from_buffer(buffer)
    bottles = [det.get_confidence() for det in
               roi.get_objects_typed(hailo.HAILO_DETECTION)
               if det.get_label() == "bottle"]
    print(user_data.get_count(), max(bottles, default=0.0))

Expected deliverable

A configuration record and a table with condition, bottle hits out of ten, empty controls with false alarms out of ten, and delay for successful detections. Keep settings from rpicam-apps separate from those of Hailo Apps if you run both. The lab has not performed this build.

Primary sources

Raspberry Pi · AI HAT+ Raspberry Pi · AI software guide Raspberry Pi’s YOLOv8 configuration Raspberry Pi’s detection stage Hailo’s tracking example Hailo’s Python callback