CV / PaddleOCR

PaddleOCR v5 モバイル向けテキスト検出

reComputer R Series (CM5 + Hailo-8)

Hailo-8 または Hailo-10H 搭載の reComputer R Series で、文書画像のテキスト領域を検出します。

82 ダウンロード
サイズ
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

PaddleOCR v5 Mobile Detection を reComputer R Series(CM5 + Hailo-8)で実行

PaddleOCR v5 Mobile Detection は、文書画像全体からテキスト領域を見つけます。独立したモデルであり、そのポリゴンまたはボックスを使ってテキスト行を切り出し、テキスト認識モデルに渡します。

モデル情報

項目値
タスクテキスト検出
入力544 × 960 × 3 の画像
出力テキスト領域の四角形と軸平行ボックス
HEFHailo-8 PaddleOCR 検出 HEF
ランタイムHailoRT 4.23.x

ホスト要件

イメージ内の Hailo-8 ドライバ、ファームウェア、ホスト libhailort.so、Python wheel は、一致する HailoRT メジャー/マイナーバージョンを使用する必要があります。

bash
sudo apt update
sudo apt install hailort hailort-pcie-driver python3-hailort
sudo reboot

hailortcli --version
hailortcli fw-control identify
ls -l /dev/hailo0

デモを実行

bash
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

プレビュー用に http://<PI_IP>:8000 を開きます。

REST API

bash
curl -X POST "http://<PI_IP>:8000/api/models/paddle_ocr_v5_mobile_detection/predict" \
  -F "file=@document.png"

レスポンスは predictions 配列を返します。各項目には、ソース画像座標での polygon と軸平行 box が含まれます。

認識モデルとの関係

このモデルはテキストをデコードしません。検出された各行を切り出すか補正し、PaddleOCR v5 Mobile Recognition に個別デプロイとして渡します。

入力と出力

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