Files
Zach Kelling fc84b98274 Fix clippy warnings and remaining CI issues
- Add Default implementation for PerplexityBenchmark
- Add #[allow(dead_code)] to FileLogger struct
- Fix remaining hanzo_examples -> hanzo_ml_examples references in example files
2026-01-17 18:03:19 -08:00
..
2026-01-16 12:30:55 -08:00
2026-01-16 12:30:55 -08:00

hanzo-ml-trocr

TrOCR is a transformer OCR Model. In this example it is used to transcribe image text. See the associated model card for details on the model itself.

Supported models include:

  • --which base: small handwritten OCR model.
  • --which large: large handwritten OCR model.
  • --which base-printed: small printed OCR model.
  • --which large-printed: large printed OCR model.

Running an example

cargo run --example trocr --release -- --image hanzo-ml-examples/examples/trocr/assets/trocr.png
cargo run --example trocr --release -- --which large --image hanzo-ml-examples/examples/trocr/assets/trocr.png
cargo run --example trocr --release -- --which base-printed --image hanzo-ml-examples/examples/trocr/assets/noto.png
cargo run --example trocr --release -- --which large-printed --image hanzo-ml-examples/examples/trocr/assets/noto.png

Outputs

industry , Mr. Brown commented icily . " Let us have a
industry , " Mr. Brown commented icily . " Let us have a
THE QUICK BROWN FOR JUMPS OVER THE LAY DOG
THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG