CV / SSD
SSD MobileNet V2
SSD MobileNet V2 is the classic TensorFlow SSD detector with a MobileNet V2 backbone, detecting 80 COCO object classes on Hailo-8. Same I/O as V1 but lighter and slightly more accurate. NMS runs on-chip (Hailo HPP, meta_arch=ssd), so the app only parses the post-NMS tensor.
Elige el dispositivo que estás usando. La guía de configuración y la documentación se actualizarán en consecuencia.
Primeros pasos
sudo docker run --rm \
--name cm5-hailo8-ssd-mobilenet-v2 \
--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/ssd_mobilenet_v2:latest \
python web_detection.py --model_path model/ssd_mobilenet_v2.hef --video_path video/test.mp4API REST
Usa la API REST para ejecutar inferencia. Copia los comandos siguientes.
curl -X POST "http://<Board_IP>:8000/api/models/ssd_mobilenet_v2/predict" \
-F "file=@test.jpg"import requests
response = requests.post(
"http://<Board_IP>:8000/api/models/ssd_mobilenet_v2/predict",
files={"file": open("test.jpg", "rb")},
timeout=30,
)
print(response.json())Detalles del modelo
SSD MobileNet V2 on reComputer R Series (CM5 + Hailo-8)
SSD MobileNet V2 is the classic TensorFlow SSD detector with a MobileNet V2
backbone. It detects 80 COCO object classes on Hailo-8. Same I/O as V1 but
lighter and slightly more accurate. NMS runs on-chip (Hailo HPP, meta_arch=ssd),
so the host only parses the post-NMS tensor.
This page targets reComputer R Series (CM5 + Hailo-8) with a PCIe Hailo-8 accelerator.
Model Info
| Property | Value |
|---|---|
| Architecture | SSD + MobileNet V2 |
| Task | Object detection |
| Input | 300x300x3 RGB (normalize_in_net mean=127.5/std=127.5) |
| Output | on-chip NMS tensor, post-NMS shape 90x8x1 |
| Classes | 90 slots (COCO IDs 1..90 via labels_offset=1; 10 unused) |
| Parameters | 4.46M |
| Operations | 1.52G |
| Postprocess | on-chip NMS (HPP); host parses post-NMS tensor |
| HEF | Hailo Model Zoo v2.19.0, Hailo-8 |
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 |
sudo apt update
sudo apt install hailort hailort-pcie-driver python3-hailort
sudo reboot
hailortcli --version
hailortcli fw-control identify
ls -l /dev/hailo0Run With Demo Video
sudo docker run --rm \
--name cm5-hailo8-ssd-mobilenet-v2 \
--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/ssd_mobilenet_v2:latest \
python web_detection.py --model_path model/ssd_mobilenet_v2.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-ssd-mobilenet-v2 \
--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/ssd_mobilenet_v2:latest \
python web_detection.py --model_path model/ssd_mobilenet_v2.hef --camera_id 0REST API
POST http://<Board_IP>:8000/api/models/ssd_mobilenet_v2/predictcurl -X POST "http://<Board_IP>:8000/api/models/ssd_mobilenet_v2/predict" \
-F "file=@test.jpg"| Endpoint | Method | Purpose |
|---|---|---|
/ | GET | Web preview UI |
/api/models/ssd_mobilenet_v2/predict | POST | Detections (JSON) |
/api/video_feed | GET | MJPEG preview stream |
Implementation Notes
- Identical I/O contract and post-processing to the V1 build; only the backbone differs (MobileNet V2 → lighter, slightly more accurate).
- The HEF runs NMS on-chip; the app only parses the post-NMS tensor
(
tf_postproc_nms), sonms_threshis ignored (API parity only). normalize_in_netmean=127.5/std=127.5 (classic SSD normalization); the app feeds raw uint8 RGB pixels after letterboxing — no manual normalization.- HailoRT returns the NMS vstream as a ragged per-class list (NMS-by-score); the parser handles ragged/object/dense layouts. First inference logs the raw type/shape so it can be verified on hardware.
- Class mapping:
cls_id(0..89) → COCO category IDcls_id+1(labels_offset=1); 10 unused COCO IDs are "N/A" and not drawn. - Defaults: confidence 0.25, IOU 0.45 (IOU no effect — NMS on-chip). Eval uses 0.3 / 0.6.
Development Notes
- Source module:
src/rpi5_hailo8_ssd_mobilenet_v2/ - Dockerfile:
docker/hailo8/ssd_mobilenet_v2.dockerfile - Container:
ghcr.io/seeed-projects/recomputer-hailo8-cv/ssd_mobilenet_v2:latest - Family: ssd (variants ssd_mobilenet_v1 / ssd_mobilenet_v2); this is the V2 build.
Entradas y salidas
Input: image, video, or USB camera frame. Output: COCO 80-class detection boxes with confidences, plus an annotated MJPEG preview.