CV / EfficientDet
EfficientDet-Lite2
EfficientDet-Lite2 with a BiFPN head detects 80 COCO object classes on Hailo-8. NMS and sigmoid run on-chip (Hailo HPP), so the app only parses the post-NMS tensor. Lite2 variant of the efficientdet family — largest backbone and 448x448 input for the highest accuracy of the three.
Choose the device you're using, the set up guide and documentation will update accordingly.
Getting Started
sudo docker run --rm \
--name cm5-hailo8-efficientdet-lite2 \
--privileged \
--net=host \
-e PYTHONUNBUFFERED=1 \
--device /dev/hailo0:/dev/hailo0 \
-v /usr/lib/libhailort.so.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
-v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
ghcr.io/seeed-projects/recomputer-hailo8-cv/efficientdet_lite2:latest \
python web_detection.py --model_path model/efficientdet_lite2.hef --video_path video/test.mp4REST API
Use the REST API to run inference. Copy the commands below.
curl -X POST "http://<Board_IP>:8000/api/models/efficientdet_lite2/predict" \
-F "file=@test.jpg"import requests
response = requests.post(
"http://<Board_IP>:8000/api/models/efficientdet_lite2/predict",
files={"file": open("test.jpg", "rb")},
timeout=30,
)
print(response.json())Model Details
EfficientDet-Lite2 on reComputer R Series (CM5 + Hailo-8)
EfficientDet-Lite2 performs COCO 80-class object detection on Hailo-8 through HailoRT. NMS and sigmoid run on-chip (Hailo HPP), so the host only parses the post-NMS tensor. This is the Lite2 variant of the efficientdet family — largest backbone and 448x448 input for the highest accuracy of the three (lite0/lite1/ lite2).
This page targets reComputer R Series (CM5 + Hailo-8) with a PCIe Hailo-8 accelerator.
Model Info
| Property | Value |
|---|---|
| Architecture | EfficientDet-Lite2 (BiFPN) |
| Task | Object detection |
| Input | 448x448x3 RGB (normalization compiled into the HEF: mean=127, std=128) |
| Output | on-chip NMS tensor, post-NMS shape 89x5x100 |
| Classes | 89 slots (COCO category IDs 1..89 via labels_offset=1; 10 unused) |
| Parameters | 5.93M |
| Operations | 6.84G |
| Postprocess | on-chip NMS (HPP) + sigmoid; host parses post-NMS tensor |
| HEF | Hailo Model Zoo v2.19.0, Hailo-8 |
The accuracy value is Hailo's Model Zoo reference. It is not a benchmark measured on CM5.
Hardware and Host Setup
| Item | Value |
|---|---|
| Board | reComputer R Series with Raspberry Pi CM5 |
| Accelerator | Hailo-8 over PCIe, exposed as /dev/hailo0 |
| Runtime | HailoRT 4.23.x |
| Python in container | 3.11, aarch64 |
Install the Hailo-8 packages on the host and confirm that the driver and device are ready before starting the container:
sudo apt update
sudo apt install hailort hailort-pcie-driver python3-hailort
sudo reboot
# After reboot
hailortcli --version
hailortcli fw-control identify
ls -l /dev/hailo0The expected HailoRT version for this image is 4.23.x.
Run With Demo Video
sudo docker run --rm \
--name cm5-hailo8-efficientdet-lite2 \
--privileged \
--net=host \
-e PYTHONUNBUFFERED=1 \
--device /dev/hailo0:/dev/hailo0 \
-v /usr/lib/libhailort.so.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
-v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
ghcr.io/seeed-projects/recomputer-hailo8-cv/efficientdet_lite2:latest \
python web_detection.py --model_path model/efficientdet_lite2.hef --video_path video/test.mp4Open http://<Board_IP>:8000 to view the web preview.
USB Camera Mode
sudo docker run --rm \
--name cm5-hailo8-efficientdet-lite2 \
--privileged \
--net=host \
-e PYTHONUNBUFFERED=1 \
--device /dev/hailo0:/dev/hailo0 \
--device /dev/video0:/dev/video0 \
-v /usr/lib/libhailort.so.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
-v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
ghcr.io/seeed-projects/recomputer-hailo8-cv/efficientdet_lite2:latest \
python web_detection.py --model_path model/efficientdet_lite2.hef --camera_id 0REST API
Prediction endpoint:
POST http://<Board_IP>:8000/api/models/efficientdet_lite2/predictExample image request:
curl -X POST "http://<Board_IP>:8000/api/models/efficientdet_lite2/predict" \
-F "file=@test.jpg"| Endpoint | Method | Purpose |
|---|---|---|
/ | GET | Web preview UI |
/api/models/efficientdet_lite2/predict | POST | Detections (JSON) |
/api/video_feed | GET | MJPEG preview stream |
Implementation Notes
- Identical input/output contract and post-processing to the Lite0/Lite1 builds; only the backbone and input size differ (448x448, 5.93M params → highest accuracy of the three).
- The HEF runs NMS on-chip (
device_pre_post_layers: nms=true, sigmoid=true, hpp=true); the app only parses the post-NMS tensor (per the officialtf_postproc_nms), sonms_threshis ignored (API parity only). - Post-NMS rows are
[ymin, xmin, ymax, xmax, score], normalized to [0,1] of the 448x448 letterboxed input; the app scales to pixels and un-letterboxes. normalize_in_netwith mean=127/std=128 +padding_color=127: the app letterboxes with gray (127) padding and feeds raw uint8 RGB pixels — no manual normalization.- HailoRT returns the NMS vstream as a ragged per-class list (NMS-by-score); the parser handles that plus object/dense layouts. First inference logs the raw type/shape so it can be verified on hardware.
- Class mapping:
cls_id(0..88) → COCO category IDcls_id+1(labels_offset=1); the 10 unused COCO IDs are "N/A" and not drawn. If labels look shifted, re-derive from the first-inference log. - Defaults: confidence 0.25, IOU 0.45 (IOU has no effect — NMS on-chip). Model Zoo eval uses 0.001 / 0.5 — lower the confidence slider to inspect more.
Development Notes
- Source module:
src/rpi5_hailo8_efficientdet_lite2/ - Dockerfile:
docker/hailo8/efficientdet_lite2.dockerfile - Container:
ghcr.io/seeed-projects/recomputer-hailo8-cv/efficientdet_lite2:latest - The module uses the HailoRT 4.23 VStreams API and a Hailo-8-specific HEF.
- Family: efficientdet (variants lite0 / lite1 / lite2); this is the lite2 build.
Inputs and Outputs
Input: image, video, or USB camera frame. Output: COCO 80-class detection boxes with confidences, plus an annotated MJPEG preview.