OCR inference in rust.
This project compiles to a single 30 mbs binary, but it's still necessary to have onnxruntime and opencv installed on the system.
Using a db_mobilenet_v2 (DBNet: Real-time Scene Text Detection with Differentiable Binarization) as detector and a crnn_vgg16_bn (CRNN: An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition) as recognizer. In principle this code can run any model that uses the approach of detector → recognizer. In this case the project is using the recognizer trained by docTR. (The detector is an older version). If you want, you can train your own model.
oc-rs 0.1.0
pauloasjx
USAGE:
oc-rs <FILE_PATH> [ARGS]
ARGS:
<FILE_PATH>
<FORMAT> [default: json] [possible values: json, text]
<resize>
OPTIONS:
-h, --help Print help information
-V, --version Print version information
Example
$ oc-rs "samples/sample.png" json | jq