From 5dacb611225a7ce4672053f288e8daafadd32ed5 Mon Sep 17 00:00:00 2001 From: Admin Date: Thu, 16 Jul 2026 19:55:23 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=81=A2=E5=A4=8D=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E5=8E=9F=E5=A7=8B=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/captcha/handler.go | 14 +++++++------- models/{math.onnx => [AntiCAP]-CRNN_Math.onnx} | Bin ...otate.onnx => [AntiCAP]-Rotation-RotNetR.onnx} | Bin ...amese.onnx => [AntiCAP]-Siamese-ResNet18.onnx} | Bin models/{charsets.txt => [Dddd]-CharSets.txt} | 0 models/{ocr.onnx => [Dddd]-OCR.onnx} | Bin 6 files changed, 7 insertions(+), 7 deletions(-) rename models/{math.onnx => [AntiCAP]-CRNN_Math.onnx} (100%) rename models/{rotate.onnx => [AntiCAP]-Rotation-RotNetR.onnx} (100%) rename models/{siamese.onnx => [AntiCAP]-Siamese-ResNet18.onnx} (100%) rename models/{charsets.txt => [Dddd]-CharSets.txt} (100%) rename models/{ocr.onnx => [Dddd]-OCR.onnx} (100%) diff --git a/internal/captcha/handler.go b/internal/captcha/handler.go index 1afa7b1..cce2a12 100644 --- a/internal/captcha/handler.go +++ b/internal/captcha/handler.go @@ -15,16 +15,16 @@ type Handler struct { mu sync.RWMutex } -// 模型配置 +// 模型配置:本地文件名 -> 远程文件名 var modelConfigs = map[string]string{ - "math.onnx": "math.onnx", - "ocr.onnx": "ocr.onnx", - "rotate.onnx": "rotate.onnx", - "siamese.onnx": "siamese.onnx", - "charsets.txt": "charsets.txt", + "CRNN_Math.onnx": "[AntiCAP]-CRNN_Math.onnx", + "OCR.onnx": "[Dddd]-OCR.onnx", + "Rotation-RotNetR.onnx": "[AntiCAP]-Rotation-RotNetR.onnx", + "Siamese-ResNet18.onnx": "[AntiCAP]-Siamese-ResNet18.onnx", + "CharSets.txt": "[Dddd]-CharSets.txt", } -// 从 Gitea 仓库下载(无需认证,公开仓库) +// 从 Gitea 仓库下载(公开仓库,无需认证) const modelBaseURL = "https://git.viaeon.com/admin/anticaptcha/raw/branch/main/models" func NewHandler(modelPath string) *Handler { diff --git a/models/math.onnx b/models/[AntiCAP]-CRNN_Math.onnx similarity index 100% rename from models/math.onnx rename to models/[AntiCAP]-CRNN_Math.onnx diff --git a/models/rotate.onnx b/models/[AntiCAP]-Rotation-RotNetR.onnx similarity index 100% rename from models/rotate.onnx rename to models/[AntiCAP]-Rotation-RotNetR.onnx diff --git a/models/siamese.onnx b/models/[AntiCAP]-Siamese-ResNet18.onnx similarity index 100% rename from models/siamese.onnx rename to models/[AntiCAP]-Siamese-ResNet18.onnx diff --git a/models/charsets.txt b/models/[Dddd]-CharSets.txt similarity index 100% rename from models/charsets.txt rename to models/[Dddd]-CharSets.txt diff --git a/models/ocr.onnx b/models/[Dddd]-OCR.onnx similarity index 100% rename from models/ocr.onnx rename to models/[Dddd]-OCR.onnx