paddleocr

Crates.iopaddleocr
lib.rspaddleocr
version0.4.1
sourcesrc
created_at2022-10-09 14:15:39.150396
updated_at2023-10-20 14:52:31.148333
descriptionA simple Rust wrapper for PaddleOCR-JSON.
homepagehttps://github.com/OverflowCat/paddleocr
repositoryhttps://github.com/OverflowCat/paddleocr
max_upload_size
id684020
size16,679
ᡥᠠᡳᡤᡳᠶᠠ ᡥᠠᠯᠠ·ᠨᡝᡴᠣ 猫 (OverflowCat)

documentation

README

Crate paddleocr

A simple wrapper for hiroi-sora/PaddleOCR-json.

Usage

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]>).

Commit count: 16

cargo fmt