CV / EfficientDet

EfficientDet-Lite0

reComputer R Series (CM5 + Hailo-10H)

COCO 80-class object detection with EfficientDet-Lite0 (on-chip NMS) on reComputer R Series with Hailo-8 or Hailo-10H.

104 downloads
Size
9.3 MB
Memory
4GB+
Precision
Hailo HEF / HailoRT

Choose the device you're using, the set up guide and documentation will update accordingly.

Getting Started

Deploy
sudo docker run --rm \
  --name cm5-hailo10h-efficientdet-lite0 \
  --privileged \
  --net=host \
  -e PYTHONUNBUFFERED=1 \
  --device /dev/hailo0:/dev/hailo0 \
  -v /usr/lib/libhailort.so.5.1.1:/usr/lib/libhailort.so.5.1.1:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  ghcr.io/seeed-projects/recomputer-hailo10h-cv/efficientdet_lite0:latest \
  python web_detection.py --model_path model/efficientdet_lite0.hef --video_path video/test.mp4

REST API

Use the REST API to run inference. Copy the commands below.

Curl
curl -X POST "http://<Board_IP>:8000/api/models/efficientdet_lite0/predict" \
  -F "file=@test.jpg"
Python
import requests

response = requests.post(
    "http://<Board_IP>:8000/api/models/efficientdet_lite0/predict",
    files={"file": open("test.jpg", "rb")},
    timeout=30,
)
print(response.json())

Model Details

reComputer R Series (CM5 + Hailo-10H)

EfficientDet-Lite0 on reComputer R Series (CM5 + Hailo-10H)

EfficientDet-Lite0 performs COCO 80-class object detection on Hailo-10H through HailoRT. NMS and sigmoid run on-chip (Hailo HPP), so the host only parses the post-NMS tensor. This is the lite0 variant of the efficientdet family.

This page targets reComputer R Series (CM5 + Hailo-10H) with a PCIe Hailo-10H accelerator.

Model Info

PropertyValue
ArchitectureEfficientDet-Lite0 (BiFPN)
TaskObject detection
Input320x320x3 RGB (normalization compiled into the HEF: mean=127, std=128)
Outputon-chip NMS tensor, post-NMS shape 89x5x100
Classes89 slots (COCO category IDs 1..89 via labels_offset=1; 10 unused)
Parameters3.56M
Operations1.94G
Postprocesson-chip NMS (HPP) + sigmoid; host parses post-NMS tensor
HEFHailo Model Zoo v5.4.0, Hailo-10H (6,483,968 bytes)

The accuracy value is Hailo's Model Zoo reference. It is not a benchmark measured on CM5.

Hardware and Host Setup

ItemValue
BoardreComputer R Series with Raspberry Pi CM5
AcceleratorHailo-10H over PCIe, exposed as /dev/hailo0
RuntimeHailoRT 5.1.1
Python in container3.13, aarch64

Install the Hailo-10H packages on the host and confirm that the driver and device are ready before starting the container:

bash
sudo apt update
sudo apt install hailo-h10-all -y
sudo reboot

# After reboot
hailortcli --version
hailortcli fw-control identify
ls -l /dev/hailo0

The expected HailoRT version for this image is 5.1.1.

Run With Demo Video

bash
sudo docker run --rm \
  --name cm5-hailo10h-efficientdet-lite0 \
  --privileged \
  --net=host \
  -e PYTHONUNBUFFERED=1 \
  --device /dev/hailo0:/dev/hailo0 \
  -v /usr/lib/libhailort.so.5.1.1:/usr/lib/libhailort.so.5.1.1:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  ghcr.io/seeed-projects/recomputer-hailo10h-cv/efficientdet_lite0:latest \
  python web_detection.py --model_path model/efficientdet_lite0.hef --video_path video/test.mp4

Open http://<Board_IP>:8000 to view the web preview.

USB Camera Mode

bash
sudo docker run --rm \
  --name cm5-hailo10h-efficientdet-lite0 \
  --privileged \
  --net=host \
  -e PYTHONUNBUFFERED=1 \
  --device /dev/hailo0:/dev/hailo0 \
  --device /dev/video0:/dev/video0 \
  -v /usr/lib/libhailort.so.5.1.1:/usr/lib/libhailort.so.5.1.1:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  ghcr.io/seeed-projects/recomputer-hailo10h-cv/efficientdet_lite0:latest \
  python web_detection.py --model_path model/efficientdet_lite0.hef --camera_id 0

REST API

text
POST http://<Board_IP>:8000/api/models/efficientdet_lite0/predict
bash
curl -X POST "http://<Board_IP>:8000/api/models/efficientdet_lite0/predict" \
  -F "file=@test.jpg"
EndpointMethodPurpose
/GETWeb preview UI
/api/models/efficientdet_lite0/predictPOSTDetections (JSON)
/api/video_feedGETMJPEG preview stream

Implementation Notes

  • The HEF runs NMS and sigmoid on-chip (device_pre_post_layers: nms=true, sigmoid=true, hpp=true); the app only parses the post-NMS tensor, so nms_thresh is ignored (API parity only).
  • Post-NMS rows are [ymin, xmin, ymax, xmax, score], normalized to [0,1] of the 320x320 letterboxed input; the app scales to pixels and un-letterboxes.
  • normalize_in_net with mean=127/std=128 and padding_color=127: the app letterboxes with gray (127) padding and feeds raw uint8 RGB pixels — no manual normalization.
  • The parser handles the HailoRT NMS layouts: the compact per-class buffer, the dense 89x5x100 / 89x100x5 forms and the ragged (NMS-by-score) list. The first inference logs the raw type and shape once for on-device verification.
  • Class mapping: cls_id (0..88) maps to COCO category ID cls_id+1 (labels_offset=1); the 10 unused COCO IDs are "N/A" and not drawn.
  • Defaults: confidence 0.25, IOU 0.45 (IOU has no effect — NMS on-chip). Lower the confidence slider to inspect more detections.

Development Notes

  • Source module: src/hailo10h_efficientdet_lite0/
  • Dockerfile: docker/hailo10h/efficientdet_lite0.dockerfile
  • Container: ghcr.io/seeed-projects/recomputer-hailo10h-cv/efficientdet_lite0:latest
  • The module uses the HailoRT 5.1.1 InferModel API and a Hailo-10H-specific HEF.
  • Unit tests run without a device: python -m unittest discover -s tests -v.

Inputs and Outputs

Input: image, video, or USB camera frame. Output: COCO 80-class detection boxes with confidences, plus an annotated MJPEG preview.