CV / FCN ResNet
FCN8 ResNet-18
FCN-8s (Fully Convolutional Network) with ResNet-18 backbone performs real-time semantic segmentation with 19 Cityscapes classes through HailoRT inference.
Choose the device you're using, the set up guide and documentation will update accordingly.
Getting Started
sudo docker run --rm \
--name cm5-hailo-fcn8-resnet \
--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/fcn8_resnet_v1_18:latest \
python web_detection.py --model_path model/fcn8_resnet_v1_18.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/fcn8_resnet/predict" \
-F "file=@test.jpg"import requests
resp = requests.post(
"http://<Board_IP>:8000/api/models/fcn8_resnet/predict",
files={"file": open("test.jpg", "rb")},
timeout=30,
)
print(resp.json())Model Details
FCN8 ResNet-18 on reComputer R Series (CM5 + Hailo-10H)
FCN-8s (Fully Convolutional Network) with ResNet-18 backbone for semantic segmentation, running on Hailo-10H via HailoRT.
This page targets reComputer R Series (CM5 + Hailo-10H) with a PCIe Hailo-10H accelerator.
Model Info
| Property | Value |
|---|---|
| Architecture | FCN-8s + ResNet-18 |
| Task | Semantic Segmentation |
| Input | 1024×1920×3 RGB |
| Output | 1024×1920 class mask (19 classes) |
| Parameters | 11.20M |
| mIoU (Cityscapes) | 69.2% (hardware) |
| Source | Hailo Model Zoo |
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-10H over PCIe, exposed as /dev/hailo0 |
| OS | Raspberry Pi OS Bookworm, aarch64 |
| Host driver | hailo-h10-all apt package |
sudo apt update
sudo apt install hailo-h10-all -y
sudo reboot
# After reboot
hailortcli fw-control identify
ls /dev/hailo0
# Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh --mirror Aliyun
sudo systemctl enable docker
sudo systemctl start dockerRun With Demo Video
sudo docker run --rm --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/fcn8_resnet_v1_18:latest \
python web_detection.py --model_path model/fcn8_resnet_v1_18.hef --video_path video/test.mp4Open http://<Board_IP>:8000 to view the web preview. The image includes the module source, demo video, HailoRT Python wheel, and HEF files listed below.
USB Camera Mode
sudo docker run --rm --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/fcn8_resnet_v1_18:latest \
python web_detection.py --model_path model/fcn8_resnet_v1_18.hef --camera_id 0HEF Files
| HEF | Size | Notes |
|---|---|---|
fcn8_resnet_v1_18.hef | 9.2 MB | Semantic segmentation model |
REST API
Prediction endpoint:
POST http://<Board_IP>:8000/api/models/fcn8_resnet/predictExample image request:
curl -X POST "http://<Board_IP>:8000/api/models/fcn8_resnet/predict" \
-F "file=@test.jpg"Common service endpoints:
| Endpoint | Method | Purpose |
|---|---|---|
/ | GET | Web preview UI |
/api/models/fcn8_resnet/predict | POST | Per-class pixel coverage (JSON) |
/api/video_feed | GET | MJPEG preview stream |
Development Notes
- Source module:
src/hailo10h_fcn8_resnet_v1_18/ - Dockerfile:
docker/hailo10h/fcn8_resnet_v1_18.dockerfile - Main service:
web_detection.pywraps HailoRT inference, post-processing, MJPEG preview, and REST prediction.
Inputs and Outputs
Input: image (1024x1920 RGB). Output: 19-class semantic segmentation mask (Cityscapes).