CV / BiSeNetV2

BiSeNetV2

reComputer R Series (CM5 + Hailo-8)

BiSeNetV2 real-time semantic segmentation on reComputer R Series with Hailo-8.

1 downloads
Size
13.0 MB
Memory
4GB+
Precision
Hailo HEF

Choose the device you're using, the set up guide and documentation will update accordingly.

Getting Started

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

REST API

Use the REST API to run inference. Copy the commands below.

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

PropertyValue
ArchitectureBiSeNetV2
TaskSemantic segmentation, 19 Cityscapes classes
Input1024x2048x3 RGB
Output1024x2048x1 argmax class-ID mask
Parameters3.36M
Operations196.84G
Float mIoU73.0
Hardware mIoU72.6
FPS (batch 1)9.69
HEFModel Zoo v2.20.0, Hailo-8
HEF size13,667,807 B
HEF SHA256a047033cb53c43e3904fdb75a2aac6e9feeb5ad44a085422c559e258725054b7

The accuracy and FPS values are Hailo Model Zoo reference numbers, not measurements from this WebUI pipeline.

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 M.2 over PCIe, /dev/hailo0
OSRaspberry Pi OS Bookworm, aarch64
Host driverhailo-all apt package
HailoRT4.23.x; driver, firmware, native library, and wheel must share major.minor
Container Python3.11, aarch64
bash
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 docker

Run With Docker

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

Open http://<Board_IP>:8000 to view the MJPEG preview and offline video analysis.

USB Camera Mode

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

REST API

bash
curl -X POST "http://<Board_IP>:8000/api/models/bisenetv2/predict" \
  -F "file=@test.jpg"
EndpointMethodPurpose
/healthGETHealth check
/api/models/bisenetv2/predictPOSTSegmentation summary (JSON)
/api/models/bisenetv2/visualizePOSTColored overlay (JPEG)
/api/models/bisenetv2/classesGETCityscapes class list
/api/video_feedGETMJPEG 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).