Giter Club home page Giter Club logo

paddleocr-onnx-sample's Introduction

PaddleOCR-ONNX-Sample


PaddleOCRのPythonでのONNX推論サンプルです。
PaddleOCRの推論スクリプトからPaddle依存処理とインポートを削除しています。

Model

以下リストのモデルを変換しています(蒸留モデルではないモデルを使用)

変換自体を試したい方はColaboratoryなどでPaddleOCR-Convert2ONNX.ipynbを使用ください。

Requirement

requirements.txt を参照ください。

Demo

デモ(シンプルなアルファベット検出)の実行方法は以下です。

python demo_simple_ocr_en.py --image=sample.jpg
  • --image
    OCR対象画像の指定
    デフォルト:sample.jpg
  • --det_model
    テキスト検出モデルの指定
    デフォルト:./ppocr_onnx/model/det_model/en_PP-OCRv3_det_infer.onnx
  • --rec_model
    テキスト認識モデルの指定
    デフォルト:./ppocr_onnx/model/rec_model/en_PP-OCRv3_rec_infer.onnx
  • --rec_char_dict
    辞書データの指定
    デフォルト:./ppocr_onnx/ppocr/utils/dict/en_dict.txt
  • --cls_model
    テキスト回転分類モデルの指定
    デフォルト:./ppocr_onnx/model/cls_model/ch_ppocr_mobile_v2.0_cls_infer.onnx
  • --use_gpu
    GPU推論の利用
    デフォルト:指定なし

デモ(日本語検出+表示)の実行方法は以下です。

python demo_draw_ocr_ja.py --image=sample.jpg
  • --device
    カメラデバイス番号の指定
    デフォルト:0
  • --movie
    動画ファイルの指定 ※指定時はカメラデバイスより優先
    デフォルト:指定なし
  • --image
    画像ファイルの指定 ※指定時はカメラデバイスや動画より優先
    デフォルト:指定なし
  • --width
    カメラキャプチャ時の横幅
    デフォルト:640
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:360
  • --det_model
    テキスト検出モデルの指定
    デフォルト:./ppocr_onnx/model/det_model/en_PP-OCRv3_det_infer.onnx
  • --rec_model
    テキスト認識モデルの指定
    デフォルト:./ppocr_onnx/model/rec_model/en_PP-OCRv3_rec_infer.onnx
  • --rec_char_dict
    辞書データの指定
    デフォルト:./ppocr_onnx/ppocr/utils/dict/en_dict.txt
  • --cls_model
    テキスト回転分類モデルの指定
    デフォルト:./ppocr_onnx/model/cls_model/ch_ppocr_mobile_v2.0_cls_infer.onnx
  • --use_gpu
    GPU推論の利用
    デフォルト:指定なし

Reference

Author

高橋かずひと(https://twitter.com/KzhtTkhs)

License

PaddleOCR-ONNX-Sample is under Apache2.0 License.

License(Image)

サンプル画像はフリー素材ぱくたそ様の写真を利用しています。

License(Font)

日本語フォントはLINE Seed JPを利用しています。

paddleocr-onnx-sample's People

Contributors

kazuhito00 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.