CV / PaddleOCR

PaddleOCR v5 Mobile Detection

Text-region detection for document images on reComputer R Series with Hailo-8 or Hailo-10H.

24 次下载
大小
5.49 MB
内存
4GB+
精度
Hailo HEF / HailoRT

选择你正在使用的设备,设置指南和文档将相应更新。

快速开始

部署
sudo docker run --rm \
  --name cm5-hailo8-paddle-ocr-v5-mobile-detection \
  --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/paddle_ocr_v5_mobile_detection:latest \
  python web_detection.py --model_path model/paddle_ocr_v5_mobile_detection.hef --video_path video/test.mp4

模型详情

reComputer R Series (CM5 + Hailo-10H)

PaddleOCR v5 Mobile Detection 在 reComputer R Series(CM5 + Hailo-10H)上运行

PaddleOCR v5 Mobile Detection 通过 HailoRT 5.1.1 在 Hailo-10H 上定位文档图像中的文本区域。DB(可微分二值化)检测头输出概率图;区域在 CPU 上提取为四边形多边形。

本页面向搭配 PCIe Hailo-10H 加速器的 reComputer R Series(CM5 + Hailo-10H)。

模型信息

属性值
架构PaddleOCR v5 Mobile(DB 文本检测器)
任务文本检测
输入544×960×3
输出文本区域概率图 → 四边形
参数量1.2M
计算量6.5G
精度4.60 DB 指标(Model Zoo 参考值)
HEFHailo Model Zoo v5.4.0,Hailo-10H

硬件与主机设置

项目值
开发板reComputer R Series(树莓派 CM5)
加速器Hailo-10H,PCIe 接口,设备节点为 /dev/hailo0
主机驱动hailo-h10-all apt 包
运行时HailoRT 5.1.1(主机与容器主次版本需一致)
容器内 Python3.13,aarch64
bash
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 docker

使用演示视频运行

bash
sudo docker run --rm \
  --name hailo10h-paddle-ocr-detection \
  --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/paddle_ocr_v5_mobile_detection:latest \
  python web_detection.py --model_path model/paddle_ocr_v5_mobile_detection.hef --video_path video/test.mp4

打开 http://<Board_IP>:8000 查看 Web 预览(检测到的文本区域周围为绿色四边形)。

USB 摄像头模式

bash
sudo docker run --rm \
  --name hailo10h-paddle-ocr-detection \
  --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/paddle_ocr_v5_mobile_detection:latest \
  python web_detection.py --model_path model/paddle_ocr_v5_mobile_detection.hef --camera_id 0

REST API

bash
curl -X POST "http://<Board_IP>:8000/api/models/paddle_ocr_v5_mobile_detection/predict" \
  -F "file=@test.png"
端点方法用途
/api/models/paddle_ocr_v5_mobile_detection/predictPOST文本区域多边形(JSON)
/api/video_feedGETMJPEG 预览流
/api/configGET / POST框分数/二值化阈值

开发说明

  • 源码模块:src/hailo10h_paddle_ocr_v5_mobile_detection/
  • Dockerfile:docker/hailo10h/paddle_ocr_v5_mobile_detection.dockerfile
  • 容器镜像:ghcr.io/seeed-projects/recomputer-hailo10h-cv/paddle_ocr_v5_mobile_detection:latest
  • DB 后处理不变;执行器为 HailoRT 5.1.1 的 create_infer_model API。
  • 在应用层与识别模块配对,读取每个检测区域内的文本。

输入与输出

Input: full document image or demo video frame. Output: detected text-region polygons, bounding boxes, and annotated MJPEG preview.