ocr-rs 2.2.2

A lightweight and efficient OCR library based on PaddleOCR models, using the MNN inference framework for high-performance text detection and recognition
Documentation
[package]
name = "ocr-rs"
version = "2.2.2"
edition = "2021"
authors = ["ChenZibo <qw.54@163.com>"]
readme = "README.md"
repository = "https://github.com/zibo-chen/rust-paddle-ocr"
license = "Apache-2.0"
description = "A lightweight and efficient OCR library based on PaddleOCR models, using the MNN inference framework for high-performance text detection and recognition"
keywords = [
    "ocr",
    "paddleocr",
    "text-recognition",
    "machine-learning",
    "computer-vision",
]
categories = ["computer-vision", "text-processing", "multimedia"]
documentation = "https://docs.rs/ocr-rs"
exclude = [
    "assets/*",
    "tests/*",
    "benches/*",
    "*.png",
    "*.jpg",
    "res/*",
    "3rd_party/*",
    "models/*",
]

[features]
default = []
# GPU 后端支持
metal = []  # macOS/iOS Metal GPU 加速
opencl = [] # OpenCL GPU 加速 (跨平台)
opengl = [] # OpenGL GPU 加速 (Android/Linux)
vulkan = [] # Vulkan GPU 加速 (跨平台)
cuda = []   # NVIDIA CUDA GPU 加速 (Linux/Windows)
coreml = [] # CoreML 加速 (macOS/iOS)

# MNN 链接方式 (默认使用预编译库,不支持的平台自动回退到源码编译)
# 强制从源码编译 MNN
build-mnn-from-source = []
# 使用预编译的 MNN 动态库,需设置 MNN_LIB_DIR 和 MNN_INCLUDE_DIR 环境变量
mnn-dynamic = []
# 使用预编译的 MNN 静态库,需设置 MNN_LIB_DIR 和 MNN_INCLUDE_DIR 环境变量
mnn-static = []

# 可选特性
async = ["tokio", "futures"]

# docs.rs 专用特性,跳过 C++ 编译
docsrs = []

[package.metadata.docs.rs]
features = ["docsrs"]
default-features = false
targets = ["x86_64-unknown-linux-gnu"]

[lib]
crate-type = ["lib", "cdylib"]

[build-dependencies]
cmake = "0.1"
cc = "1.0"
bindgen = "0.69"

[dependencies]
image = "0.25"
imageproc = "0.25"
ndarray = { version = "0.16", features = ["rayon"] }
thiserror = "2"
log = "0.4"
rayon = "1.8"
env_logger = "0.10"
fast_image_resize = { version = "5", features = ["image"] }

# 异步支持 (可选)
tokio = { version = "1", features = ["sync", "rt"], optional = true }
futures = { version = "0.3", optional = true }

[dev-dependencies]
criterion = "0.5"


[[example]]
name = "advanced"
path = "examples/advanced.rs"

[[example]]
name = "gpu_inference"
path = "examples/gpu_inference.rs"

[profile.dev]
opt-level = 3