https://github.com/overflowcat/paddleocr
A simple wrapper for hiroi-sora/PaddleOCR-json.
https://github.com/overflowcat/paddleocr
ocr paddleocr rust
Last synced: about 1 year ago
JSON representation
A simple wrapper for hiroi-sora/PaddleOCR-json.
- Host: GitHub
- URL: https://github.com/overflowcat/paddleocr
- Owner: OverflowCat
- Created: 2022-10-09T14:00:35.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-10-20T15:05:33.000Z (over 2 years ago)
- Last Synced: 2025-04-06T17:58:52.374Z (about 1 year ago)
- Topics: ocr, paddleocr, rust
- Language: Rust
- Homepage: https://docs.rs/paddleocr/latest/paddleocr/struct.Ppocr.html
- Size: 17.6 KB
- Stars: 14
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Crate `paddleocr`
[](https://crates.io/crates/paddleocr/)
A simple wrapper for [`hiroi-sora/PaddleOCR-json`](https://github.com/hiroi-sora/PaddleOCR-json).
## Usage
```rust
let mut p = paddleocr::Ppocr::new(
PathBuf::from(".../PaddleOCR-json.exe"), // path to binary
Default::default(), // language config_path, default `zh_CN`
)
.unwrap(); // initialize
let now = std::time::Instant::now(); // benchmark
{
// OCR files
println!("{}", p.ocr(Path::new(".../test1.png").into()).unwrap());
println!("{}", p.ocr(Path::new(".../test2.png").into()).unwrap());
println!("{}", p.ocr(Path::new(".../test3.png").into()).unwrap());
// OCR clipboard
println!("{}", p.ocr_clipboard().unwrap());
}
println!("Elapsed: {:.2?}", now.elapsed());
```
Use `ocr_and_parse` to get structured results.
By enabling the `bytes` feature, you can pass image data as a byte array (`AsRef<[u8]>`).