fix: lower threshold for small order images (284x106)
Build and Deploy / build (push) Successful in 2m42s
Build and Deploy / deploy (push) Successful in 9s

This commit is contained in:
2026-07-17 20:52:36 +00:00
parent 1187a35fcf
commit 16e49a6d9e
+2 -2
View File
@@ -896,8 +896,8 @@ func (h *Handler) detectYOLO(modelName, imageBase64 string) (*DetectionResult, e
// 需要转置 + NMS 后处理,坐标从 640x640 缩放到原图尺寸
// 对于小图片(order 提示图)使用更低的置信度阈值
confThresh := 0.25
if origW < 200 || origH < 100 {
confThresh = 0.1 // 小图使用更低阈值
if origW < 300 || origH < 150 {
confThresh = 0.05 // 小图使用更低阈值
}
detections := postprocessYOLO(output, origW, origH, confThresh, 0.45)