refactor: 抽象解耦推理引擎并重构为多Crate工作空间架构
- 移除 核心层与 tract/Tensor 的强耦合,前/后处理全线转用标准 ndarray - 针对 OCR 与目标检测(Det)分别设计独立的强类型输出小枚举(OcrOutput/DetOutput) - 利用 Trait 关联类型(Associated Type)InferenceEngine,OcrEngine,DetEngine 统一接口,实现多后端解耦 - 引入 thiserror 库,建立完备的强类型错误处理机制(DdddError/Result) - 完成项目结构初拆,剥离为 ddddocr-core 和 ddddocr-tract
This commit is contained in:
24
ddddocr-tract/Cargo.toml
Normal file
24
ddddocr-tract/Cargo.toml
Normal file
@@ -0,0 +1,24 @@
|
||||
[package]
|
||||
name = "ddddocr-tract"
|
||||
version = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
license = { workspace = true }
|
||||
|
||||
[dependencies]
|
||||
|
||||
ddddocr-core = { path = "../ddddocr-core" } # 引入兄弟库
|
||||
tract-onnx = "0.21.10"
|
||||
anyhow = "1.0.102"
|
||||
image = { workspace = true }
|
||||
base64 = "0.22.1"
|
||||
imageproc = { version = "0.26.2", default-features = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = "1.0.150"
|
||||
ndarray = { workspace = true } # 继承自工作空间
|
||||
thiserror = { workspace = true } # 刚好可以开始接入你需要的标准库错误处理
|
||||
|
||||
|
||||
|
||||
[features]
|
||||
default = []
|
||||
embed-models = [] # 这是一个留给有特殊需求、且自己下载了模型放入 models/ 目录的人的后门
|
||||
Reference in New Issue
Block a user