CV / ResNet
ResNet v1
reComputer R Series (CM5 + Hailo-8)
ResNet v1-18/34/50 ImageNet classification on reComputer R Series with Hailo-8 or Hailo-10H.
Choose the device you're using, the set up guide and documentation will update accordingly.
Getting Started
sudo docker run --rm \
--name pi5-hailo8-resnet-v1-18 \
--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/resnet_v1_18:latest \
python web_detection.py --model_path model/resnet_v1_18.hef --video_path video/test.mp4Model Details
reComputer R Series (CM5 + Hailo-8)ResNet v1-18/v1-34/v1-50 ImageNet Classification on reComputer R Series (CM5 + Hailo-8)
ResNet v1-18/v1-34/v1-50 classify 1000 ImageNet classes on Hailo-8 through HailoRT 4.23. Each HEF takes a 224×224 RGB frame and returns 1000 scores; the host applies softmax, smooths the scores over time and overlays a Top-K panel on the MJPEG preview. All three variants share the same web service and the official Hailo demo video.
Model Info
| Variant | Input | Packaged HEF | Top-1 float / Hailo-8 | Params / Ops | Container |
|---|---|---|---|---|---|
| ResNet v1-18 | 224×224×3 RGB | 12.5 MB | 71.3 / 71.1 | 11.68M / 3.64G | resnet_v1_18 |
| ResNet v1-34 | 224×224×3 RGB | 15.7 MB | 72.7 / 72.2 | 21.79M / 7.34G | resnet_v1_34 |
| ResNet v1-50 | 224×224×3 RGB | 18.0 MB | 75.2 / 74.7 | 25.53M / 6.98G | resnet_v1_50 |
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 (host / container must share major.minor) |
| Python in container | 3.11, aarch64 |
sudo apt update
sudo apt install hailo-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
Select the command matching the model variant.
ResNet v1-18
sudo docker run --rm \
--name pi5-hailo8-resnet-v1-18 \
--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/resnet_v1_18:latest \
python web_detection.py --model_path model/resnet_v1_18.hef --video_path video/test.mp4ResNet v1-34
sudo docker run --rm \
--name pi5-hailo8-resnet-v1-34 \
--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/resnet_v1_34:latest \
python web_detection.py --model_path model/resnet_v1_34.hef --video_path video/test.mp4ResNet v1-50
sudo docker run --rm \
--name pi5-hailo8-resnet-v1-50 \
--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/resnet_v1_50:latest \
python web_detection.py --model_path model/resnet_v1_50.hef --video_path video/test.mp4Open http://<Board_IP>:8000 to view the Top-K overlay. The bundled
video/test.mp4 is Hailo's official classifier demo clip (example.mp4, a
street scene with cars and people).
USB Camera Mode
sudo docker run --rm \
--name pi5-hailo8-resnet-v1-18 \
--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/resnet_v1_18:latest \
python web_detection.py --model_path model/resnet_v1_18.hef --camera_id 0REST API
Each variant has its own endpoint:
| Variant | Endpoint |
|---|---|
| ResNet v1-18 | POST /api/models/resnet_v1_18/predict |
| ResNet v1-34 | POST /api/models/resnet_v1_34/predict |
| ResNet v1-50 | POST /api/models/resnet_v1_50/predict |
curl -X POST "http://<Board_IP>:8000/api/models/resnet_v1_18/predict" \
-F "file=@test.jpg" -F "conf=0.30" -F "iou=5"Returns predictions entries with the ImageNet class name, a short label and
the confidence. iou is reused as the Top-K count for API parity with the
detection modules.
Implementation Notes
- Each HEF exposes a single 1000-way score vector;
softmaxandargmaxare disabled in the compile, so the host runs softmax and Top-K. - Pre-processing is a plain resize to 224×224 and BGR→RGB; the ImageNet mean/std normalization is compiled into the HEF. No letterbox is used.
- The live preview smooths the probability vector (0.6 previous + 0.4 current) to stop the label flickering, then draws the Top-K panel.
- The HEF input size is read at startup (224×224).
Development Notes
- Sources:
src/rpi5_hailo8_resnet_v1_{18,34,50}/ - Dockerfiles:
docker/hailo8/resnet_v1_{18,34,50}.dockerfile - Containers:
ghcr.io/seeed-projects/recomputer-hailo8-cv/resnet_v1_{18,34,50}:latest - HEFs: Hailo Model Zoo v2.20.0 (
hailo8), sizes and SHA256 recorded in each module'smodel/README.md - Demo video:
https://hailo-csdata.s3.eu-west-2.amazonaws.com/resources/video/example.mp4(fromhailo-ai/hailo-apps, MIT)
Inputs and Outputs
Input: image, video frame, or camera frame. Output: Top-K ImageNet labels and confidence scores.