CV / BiSeNetV2
BiSeNetV2
reComputer R Series (CM5 + Hailo-8)
BiSeNetV2 real-time semantic segmentation on reComputer R Series with Hailo-8.
Choose the device you're using, the set up guide and documentation will update accordingly.
Getting Started
sudo docker run --rm \
--name cm5-hailo8-bisenetv2 \
--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/bisenetv2:latest \
python web_detection.py --model_path model/bisenetv2.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/bisenetv2/predict" \
-F "file=@test.jpg"import requests
resp = requests.post(
"http://<BOARD_IP>:8000/api/models/bisenetv2/predict",
files={"file": open("test.jpg", "rb")},
timeout=30,
)
print(resp.json())Model Details
BiSeNetV2 on reComputer R Series (CM5 + Hailo-8)
BiSeNetV2 performs 19-class Cityscapes semantic segmentation on Hailo-8 through HailoRT. The official Hailo-8 HEF takes a 1024x2048 RGB image, performs normalization and argmax in-network, and returns a single-channel class-ID mask.
This page targets reComputer R Series (CM5 + Hailo-8) with a PCIe Hailo-8 accelerator.
Model Info
| Property | Value |
|---|---|
| Architecture | BiSeNetV2 |
| Task | Semantic segmentation, 19 Cityscapes classes |
| Input | 1024x2048x3 RGB |
| Output | 1024x2048x1 argmax class-ID mask |
| Parameters | 3.36M |
| Operations | 196.84G |
| Float mIoU | 73.0 |
| Hardware mIoU | 72.6 |
| FPS (batch 1) | 9.69 |
| HEF | Model Zoo v2.20.0, Hailo-8 |
| HEF size | 13,667,807 B |
| HEF SHA256 | a047033cb53c43e3904fdb75a2aac6e9feeb5ad44a085422c559e258725054b7 |
The accuracy and FPS values are Hailo Model Zoo reference numbers, not measurements from this WebUI pipeline.
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 M.2 over PCIe, /dev/hailo0 |
| OS | Raspberry Pi OS Bookworm, aarch64 |
| Host driver | hailo-all apt package |
| HailoRT | 4.23.x; driver, firmware, native library, and wheel must share major.minor |
| Container Python | 3.11, aarch64 |
sudo apt update
sudo apt install hailo-all
sudo reboot
hailortcli --version
hailortcli fw-control identify
ls -l /dev/hailo0
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 Docker
sudo docker run --rm \
--name cm5-hailo8-bisenetv2 \
--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/bisenetv2:latest \
python web_detection.py --model_path model/bisenetv2.hef --video_path video/test.mp4Open http://<Board_IP>:8000 to view the MJPEG preview and offline video
analysis.
USB Camera Mode
sudo docker run --rm \
--name cm5-hailo8-bisenetv2 \
--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/bisenetv2:latest \
python web_detection.py --model_path model/bisenetv2.hef --camera_id 0REST API
curl -X POST "http://<Board_IP>:8000/api/models/bisenetv2/predict" \
-F "file=@test.jpg"| Endpoint | Method | Purpose |
|---|---|---|
/health | GET | Health check |
/api/models/bisenetv2/predict | POST | Segmentation summary (JSON) |
/api/models/bisenetv2/visualize | POST | Colored overlay (JPEG) |
/api/models/bisenetv2/classes | GET | Cityscapes class list |
/api/video_feed | GET | MJPEG preview stream |
Implementation Notes
- The HEF applies normalization in-network with mean
[83.054, 94.095, 82.187]and std[53.856, 54.774, 53.933], RGB order. The host sends raw RGB uint8 pixels and does not subtract the mean or divide by the std. - The output is already an argmax class-ID mask, not a 19-channel probability tensor. The host maps IDs 0..18 to the Cityscapes palette and blends the overlay with the original frame.
- The input is letterboxed to 1024x2048 with black padding, and the mask is un-letterboxed back to the original frame before drawing.
- The 1024x2048 input is expensive on Hailo-8; the official batch-1 reference is 9.69 FPS, so live preview and offline analysis share the accelerator.
Limitations
- The Web service targets a trusted LAN and has no authentication or TLS.
- Output videos have no audio; odd dimensions may be cropped for encoding.
- The module uses the Hailo-8-specific HEF. Do not substitute a Hailo-10H, Hailo-15H, or Hailo-8L HEF.
- The WebUI throughput is not the same as the Model Zoo's isolated batch-1 FPS.
Inputs and Outputs
Input: image (1024x2048 RGB). Output: 19-class semantic segmentation mask (Cityscapes).