refactor: 重构 core 包目录结构并消除旧版 mod.rs

- 优化 剥离 models,algo 层并平铺业务模块
- 重构 统一使用现代 filename.rs + 文件夹结构替代旧版 mod.rs
This commit is contained in:
2026-07-11 17:38:30 +08:00
parent ea7fb43a14
commit 4fd38022fd
22 changed files with 209 additions and 251 deletions

View File

@@ -1,4 +1,4 @@
use crate::loader::{ModelLoader, ModelSession, ModelType};
use crate::loader::ModelLoader;
use anyhow::Context;
use ddddocr_core::error::{DdddError, Result};
use ddddocr_core::{DetEngine, DetOutput, InferenceEngine};
@@ -10,15 +10,6 @@ pub struct DetSession {
pub session: RunnableModel<TypedFact, Box<dyn TypedOp>, Graph<TypedFact, Box<dyn TypedOp>>>,
}
impl ModelSession for DetSession {
fn get_model_type(&self) -> ModelType {
todo!()
}
fn desc(&self) -> String {
"Detection Model 加载成功".to_string()
}
}
impl DetSession {
pub fn new<P>(model_path: P) -> Result<Self>
where