docs: mark Detection models as optional (YOLO11 requires special post-processing)
Build and Deploy / build (push) Successful in 3m10s
Build and Deploy / deploy (push) Successful in 1s

This commit is contained in:
2026-07-17 01:32:36 +00:00
parent 94e0283069
commit bd8db9ba27
+7 -6
View File
@@ -35,9 +35,10 @@ var modelConfigs = map[string]struct {
"Rotation-RotNetR.onnx": {remote: "[AntiCAP]-Rotation-RotNetR.onnx", optional: false},
"Siamese-ResNet18.onnx": {remote: "[AntiCAP]-Siamese-ResNet18.onnx", optional: false},
"CharSets.txt": {remote: "[Dddd]-CharSets.txt", optional: false},
// Detection 模型已转换为 opset 12,兼容 OpenCV 4.6
"Detection_Icon.onnx": {remote: "Detection_Icon.onnx", optional: false},
"Detection_Text.onnx": {remote: "Detection_Text.onnx", optional: false},
// Detection 模型需要 YOLO11 后处理支持,OpenCV 4.6 不兼容,暂标记为可选
// 后续可用 ONNX Runtime 实现或升级 OpenCV 4.9+
"Detection_Icon.onnx": {remote: "Detection_Icon.onnx", optional: true},
"Detection_Text.onnx": {remote: "Detection_Text.onnx", optional: true},
}
// 从 Gitea 仓库下载(公开仓库,无需认证)
@@ -96,11 +97,11 @@ func (h *Handler) loadModels() {
}
}
// 加载 YOLO 检测模型(opset 12 兼容 OpenCV 4.6
// 加载 YOLO 检测模型(YOLO11 需要特殊后处理,OpenCV 4.6 不完全支持
iconPath := filepath.Join(h.modelPath, "Detection_Icon.onnx")
if _, err := os.Stat(iconPath); err == nil {
if err := opencv.LoadYOLO("icon", iconPath, ""); err != nil {
fmt.Printf("警告: 加载 Icon 检测模型失败: %v\n", err)
fmt.Printf("提示: Icon 检测模型暂不支持 (需要 YOLO11 后处理): %v\n", err)
} else {
fmt.Println("Icon 检测模型加载成功")
}
@@ -109,7 +110,7 @@ func (h *Handler) loadModels() {
textPath := filepath.Join(h.modelPath, "Detection_Text.onnx")
if _, err := os.Stat(textPath); err == nil {
if err := opencv.LoadYOLO("text", textPath, ""); err != nil {
fmt.Printf("警告: 加载 Text 检测模型失败: %v\n", err)
fmt.Printf("提示: Text 检测模型暂不支持 (需要 YOLO11 后处理): %v\n", err)
} else {
fmt.Println("Text 检测模型加载成功")
}