CV / STDC1

STDC1

STDC1 (Short-Term Dense Concatenate) führt semantische Segmentierung mit 19 Cityscapes-Klassen über den HailoRT-Inferenzdienst aus.

12 Downloads
Größe
11 MB
Speicher
4GB+
Präzision
Hailo HEF / HailoRT

Wähle das Gerät, das du verwendest. Die Einrichtungsanleitung und Dokumentation werden entsprechend aktualisiert.

Erste Schritte

Bereitstellen
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.mp4

REST API

Verwende die REST API für die Inferenz. Kopiere die folgenden Befehle.

Curl
curl -X POST "http://<Board_IP>:8000/api/models/stdc1/predict" \
  -F "file=@test.jpg"
Python
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

PropertyValue
ArchitectureSTDC1 (Short-Term Dense Concatenate)
TaskSemantic segmentation
Input1024x1920x3 RGB
Output1024x1920 class mask (19 classes)
Parameters8.27M
mIoU (Cityscapes)73.8% hardware reference
HEFHailo 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

IDClassIDClassIDClass
0road7traffic sign14truck
1sidewalk8vegetation15bus
2building9terrain16train
3wall10sky17motorcycle
4fence11person18bicycle
5pole12rider
6traffic light13car

Hardware and Host Setup

ItemValue
BoardreComputer R Series with Raspberry Pi CM5
AcceleratorHailo-8 over PCIe, exposed as /dev/hailo0
RuntimeHailoRT 4.23.x
Python in container3.11, aarch64

Install the Hailo-8 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-all
sudo reboot

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

The expected HailoRT version for this image is 4.23.x.

Run With Demo Video

bash
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.mp4

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

USB Camera Mode

bash
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 0

REST API

Prediction endpoint:

text
POST http://<Board_IP>:8000/api/models/stdc1/predict

Example image request:

bash
curl -X POST "http://<Board_IP>:8000/api/models/stdc1/predict" \
  -F "file=@test.jpg"
EndpointMethodPurpose
/GETWeb preview UI
/api/models/stdc1/predictPOSTSegmentation mask (JSON)
/api/models/stdc1/visualizePOSTOverlay image (JPEG)
/api/models/stdc1/classesGETCityscapes class list
/api/video_feedGETMJPEG 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).