Crates.io | paddleocr |
lib.rs | paddleocr |
version | 0.4.1 |
source | src |
created_at | 2022-10-09 14:15:39.150396 |
updated_at | 2023-10-20 14:52:31.148333 |
description | A simple Rust wrapper for PaddleOCR-JSON. |
homepage | https://github.com/OverflowCat/paddleocr |
repository | https://github.com/OverflowCat/paddleocr |
max_upload_size | |
id | 684020 |
size | 16,679 |
paddleocr
A simple wrapper for hiroi-sora/PaddleOCR-json
.
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]>
).