Files
ssw c303c315e5 rocr: rusto-rs 源码入库(上游 v0.2.5 基线 57609fc + 本地补丁)
- 源码 316 文件收编为 rusto-rs/ 文件夹,随本仓库管理
- 移除内部 .git(补丁已存档 docs/rusto-rs-metal-patch-20260912.patch,上游可随时 re-clone)
- target/ 与 docs/.yarn 缓存不入库;本地改动:ROCR_* 环境变量调优 + Metal 链接修复 + 预处理测试脚本
2026-09-12 17:30:04 +08:00

95 lines
2.0 KiB
TOML

[workspace]
members = [".", "crates/mnn-sys", "crates/mnn"]
[package]
name = "rusto-rs"
version = "0.2.5"
edition = "2021"
description = "RustO! - Pure Rust OCR library based on RapidOCR with PaddleOCR engine"
license = "MIT"
repository = "https://github.com/byrizki/rusto-rs"
keywords = ["ocr", "paddle", "mnn", "computer-vision", "text-recognition"]
categories = ["computer-vision", "text-processing"]
include = [
"/src/**",
"/Cargo.toml",
"/README.md",
"/LICENSE*",
"/CHANGELOG.md"
]
[lib]
name = "rusto"
path = "src/lib.rs"
crate-type = ["cdylib", "staticlib", "rlib"]
[dependencies]
ndarray = { version = "0.16", features = ["rayon"] }
thiserror = "1.0"
geo-clipper = "0.9"
geo-types = "0.7"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
clap = { version = "4.5", features = ["derive"] }
rayon = "1.10"
# Pure Rust image processing (default)
image = { version = "0.25", default-features = false, features = ["png", "jpeg"] }
nalgebra = "0.33"
# Optional OpenCV backend
opencv = { version = "0.97.2", optional = true }
# Local MNN bindings
mnn = { package = "rusto-mnn", path = "crates/mnn", version = "0.2.5" }
# JNI bindings for Android
jni = { version = "0.21", optional = true }
[dev-dependencies]
criterion = "0.5"
[features]
default = []
use-opencv = ["opencv"]
ffi = ["dep:jni"] # Enable C FFI and JNI bindings
# Features
build-from-source = ["mnn/build-from-source"]
# MNN GPU/Accelerator backends
metal = ["mnn/metal"]
coreml = ["mnn/coreml"]
opencl = ["mnn/opencl"]
vulkan = ["mnn/vulkan"]
cuda = ["mnn/cuda"]
# MNN Mobile NPU backends
nnapi = ["mnn/nnapi"]
hiai = ["mnn/hiai"]
qnn = ["mnn/qnn"]
[profile.dev]
# Faster dev builds
opt-level = 1
debug = true
incremental = true
[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
strip = true
panic = "abort"
[profile.release-with-debug]
inherits = "release"
debug = true
strip = false
# Fast compilation profile for testing
[profile.test]
opt-level = 1
debug = true
incremental = true