CV / STDC1
STDC1
STDC1 (Short-Term Dense Concatenate) führt semantische Segmentierung mit 19 Cityscapes-Klassen über den HailoRT-Inferenzdienst aus.
Wähle das Gerät, das du verwendest. Die Einrichtungsanleitung und Dokumentation werden entsprechend aktualisiert.
Erste Schritte
sudo docker run --rm \
--name cm5-hailo8-stdc1 \
--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/stdc1:latest \
python web_detection.py --model_path model/stdc1.hef --video_path video/test.mp4REST API
Verwende die REST API für die Inferenz. Kopiere die folgenden Befehle.
curl -X POST "http://<Board_IP>:8000/api/models/stdc1/predict" \
-F "file=@test.jpg"import requests
resp = requests.post(
"http://<Board_IP>:8000/api/models/stdc1/predict",
files={"file": open("test.jpg", "rb")},
timeout=30,
)
print(resp.json())Modelldetails
reComputer R Series (CM5 + Hailo-8)STDC1 on reComputer R Series (CM5 + Hailo-8)
STDC1 (Short-Term Dense Concatenate) performs real-time semantic segmentation with 19 Cityscapes classes on Hailo-8 through HailoRT.
This page targets reComputer R Series (CM5 + Hailo-8) with a PCIe Hailo-8 accelerator.
Model Info
| Property | Value |
|---|---|
| Architecture | STDC1 (Short-Term Dense Concatenate) |
| Task | Semantic segmentation |
| Input | 1024x1920x3 RGB |
| Output | 1024x1920 class mask (19 classes) |
| Parameters | 8.27M |
| mIoU (Cityscapes) | 73.8% hardware reference |
| HEF | Hailo Model Zoo v2.19.0, Hailo-8 |
The accuracy value above is Hailo's Model Zoo reference. It is not a benchmark measured on CM5.
Cityscapes Classes
| ID | Class | ID | Class | ID | Class |
|---|---|---|---|---|---|
| 0 | road | 7 | traffic sign | 14 | truck |
| 1 | sidewalk | 8 | vegetation | 15 | bus |
| 2 | building | 9 | terrain | 16 | train |
| 3 | wall | 10 | sky | 17 | motorcycle |
| 4 | fence | 11 | person | 18 | bicycle |
| 5 | pole | 12 | rider | ||
| 6 | traffic light | 13 | car |
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 hailo-all
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-stdc1 \
--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/stdc1:latest \
python web_detection.py --model_path model/stdc1.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-stdc1 \
--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/stdc1:latest \
python web_detection.py --model_path model/stdc1.hef --camera_id 0REST API
Prediction endpoint:
POST http://<Board_IP>:8000/api/models/stdc1/predictExample image request:
curl -X POST "http://<Board_IP>:8000/api/models/stdc1/predict" \
-F "file=@test.jpg"| Endpoint | Method | Purpose |
|---|---|---|
/ | GET | Web preview UI |
/api/models/stdc1/predict | POST | Segmentation mask (JSON) |
/api/models/stdc1/visualize | POST | Overlay image (JPEG) |
/api/models/stdc1/classes | GET | Cityscapes class list |
/api/video_feed | GET | MJPEG preview stream |
Development Notes
- Source module:
src/rpi5_hailo8_stdc1/ - Dockerfile:
docker/hailo8/stdc1.dockerfile - Container:
ghcr.io/seeed-projects/recomputer-hailo8-cv/stdc1:latest - The module uses the HailoRT 4.23 VStreams API and a Hailo-8-specific HEF.
Eingaben und Ausgaben
Eingabe: Bild (1024x1920 RGB). Ausgabe: 19-Klassen semantische Segmentierungsmaske (Cityscapes).