CV / YOLACT
YOLACT-RegNetX-1.6GF
reComputer R Series (CM5 + Hailo-10H)
在搭载 Hailo-8 或 Hailo-10H 的 reComputer R Series 上进行实时实例分割(COCO 80 类,掩膜与检测框)。
84 次下载
大小
36 MB内存
4GB+精度
Hailo HEF / HailoRT选择你正在使用的设备,设置指南和文档将相应更新。
快速开始
部署
sudo docker run --rm \
--name cm5-hailo10h-yolact-1-6gf \
--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/yolact_regnetx_1_6gf:latest \
python web_detection.py --model_path model/yolact_regnetx_1_6gf.hef --video_path video/test.mp4REST API
使用 REST API 进行推理。复制以下命令。
Curl
curl -X POST "http://<Board_IP>:8000/api/models/yolact_regnetx_1_6gf/predict" \
-F "file=@test.jpg"Python
import requests
response = requests.post(
"http://<Board_IP>:8000/api/models/yolact_regnetx_1_6gf/predict",
files={"file": open("test.jpg", "rb")},
timeout=30,
)
print(response.json())模型详情
reComputer R Series (CM5 + Hailo-10H)在 reComputer R Series (CM5 + Hailo-10H) 上运行 YOLACT-RegNetX-1.6GF
YOLACT(UC Davis)通过 HailoRT 5.1.1 在 Hailo-10H 上执行实时实例分割,为 COCO 80 类边界框中的各个目标生成掩码。HEF 暴露 16 个原始输出头,所有解码均在主机 CPU 上执行。
模型信息
| 属性 | 值 |
|---|---|
| 架构 | YOLACT (You Only Look At CoefficienTs), RegNetX-1.6GF 骨干网络 |
| 任务 | 实例分割 |
| 输入 | 512x512x3 RGB (normalize_in_net ImageNet RGB mean/std) |
| 输出 | 16 个输出头:proto(128x128x32)+ 5 个尺度 x {bbox, mask coeffs, conf} |
| 先验框 | 49,104 个锚框(9/单元,特征图 64/32/16/8/4) |
| 类别数 | 80 (COCO) |
| 参数量 | 30.09M |
| 运算量 | 125.34G |
| HEF | Hailo Model Zoo v5.4.0, Hailo-10H (38.9 MB) |
硬件与主机设置
| 项目 | 值 |
|---|---|
| 开发板 | 配备 Raspberry Pi CM5 的 reComputer R Series |
| 加速器 | Hailo-10H 通过 PCIe 连接,设备为 /dev/hailo0 |
| 主机驱动 | hailo-h10-all apt 软件包 |
| 运行时 | HailoRT 5.1.1 |
| 容器内 Python | 3.13, aarch64 |
bash
sudo apt update
sudo apt install hailo-h10-all -y
sudo reboot
# After reboot
hailortcli fw-control identify
ls /dev/hailo0使用演示视频运行
bash
sudo docker run --rm \
--name cm5-hailo10h-yolact-1-6gf \
--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/yolact_regnetx_1_6gf:latest \
python web_detection.py --model_path model/yolact_regnetx_1_6gf.hef --video_path video/test.mp4打开 http://<Board_IP>:8000 查看网页预览(MJPEG 流上叠加彩色实例掩码)。
REST API
bash
curl -X POST "http://<Board_IP>:8000/api/models/yolact_regnetx_1_6gf/predict" -F "file=@test.jpg"| 端点 | 方法 | 用途 |
|---|---|---|
/api/models/yolact_regnetx_1_6gf/predict | POST | 边界框、置信度、掩码面积(JSON) |
/api/video_feed | GET | 带掩码的 MJPEG 预览流 |
实现说明
- CPU 后处理(
meta_arch=yolact):49,104 个锚框 → SSD 解码 → Fast NMS →sigmoid(proto @ coeffs^T)掩码组装;基于 Model Zoo 的instance_segmentation_postprocessing.py移植为 numpy 实现。 - 执行器是 HailoRT 5.1.1 的多输出 FLOAT32 封装(16 个输出头);首次推理按 SOP 验收清单打印每个输出头的值域。
normalize_in_net使用 ImageNet RGB;应用输入原始 uint8 RGB 数据。- 预处理:直接双线性缩放至 512x512(不做 letterbox,不填充)。
开发说明
- 源码模块:
src/hailo10h_yolact_regnetx_1_6gf/ - Dockerfile:
docker/hailo10h/yolact_regnetx_1_6gf.dockerfile - 容器:
ghcr.io/seeed-projects/recomputer-hailo10h-cv/yolact_regnetx_1_6gf:latest - 系列:YOLACT(变体:regnetx_800mf / regnetx_1.6gf)
输入与输出
Input: image, video, or USB camera frame. Output: COCO 80-class boxes with confidences, per-object mask pixel areas, and an MJPEG preview with colored instance masks.