From 196854dc34669ce72b9e2d9fedefdc6a929d56c6 Mon Sep 17 00:00:00 2001 From: "admin@86maid.com" Date: Thu, 13 Jun 2024 19:28:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=BA=E8=BF=AB=E7=97=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 848327a..2834d74 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,18 +1,16 @@ /// 初始化内容识别。 pub fn ddddocr_classification() -> anyhow::Result> { - let charset = include_str!("../model/common.json"); Ddddocr::new( include_bytes!("../model/common.onnx"), - serde_json::from_str(charset).unwrap(), + serde_json::from_str(include_str!("../model/common.json")).unwrap(), ) } /// 使用旧模型初始化内容识别。 pub fn ddddocr_classification_old() -> anyhow::Result> { - let charset = include_str!("../model/common_old.json"); Ddddocr::new( include_bytes!("../model/common_old.onnx"), - serde_json::from_str(charset).unwrap(), + serde_json::from_str(include_str!("../model/common_old.json")).unwrap(), ) }