mirror of
https://github.com/huggingface/candle.git
synced 2025-06-14 09:57:10 +00:00
docs: add trocr examples (#1692)
This commit is contained in:

committed by
GitHub

parent
27ffd644a9
commit
8ab384e63d
BIN
candle-examples/examples/trocr/assets/noto.png
Normal file
BIN
candle-examples/examples/trocr/assets/noto.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.5 KiB |
@ -6,6 +6,7 @@ card](https://huggingface.co/microsoft/trocr-base-printed) 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.
|
||||
@ -14,9 +15,17 @@ Supported models include:
|
||||
## Running an example
|
||||
|
||||
```bash
|
||||
cargo run --example trocr --release -- --image candle-examples/examples/trocr/assets/trocr.png
|
||||
cargo run --example trocr --release -- --image candle-examples/examples/trocr/assets/trocr.png
|
||||
cargo run --example trocr --release -- --which large --image candle-examples/examples/trocr/assets/trocr.png
|
||||
cargo run --example trocr --release -- --which base-printed --image candle-examples/examples/trocr/assets/noto.png
|
||||
cargo run --example trocr --release -- --which large-printed --image candle-examples/examples/trocr/assets/noto.png
|
||||
```
|
||||
|
||||
### Outputs
|
||||
|
||||
```
|
||||
<s> industry , Mr. Brown commented icily . " Let us have a</s>
|
||||
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
|
||||
```
|
||||
|
Reference in New Issue
Block a user