fix: lower threshold for small order images (284x106)
This commit is contained in:
@@ -896,8 +896,8 @@ func (h *Handler) detectYOLO(modelName, imageBase64 string) (*DetectionResult, e
|
|||||||
// 需要转置 + NMS 后处理,坐标从 640x640 缩放到原图尺寸
|
// 需要转置 + NMS 后处理,坐标从 640x640 缩放到原图尺寸
|
||||||
// 对于小图片(order 提示图)使用更低的置信度阈值
|
// 对于小图片(order 提示图)使用更低的置信度阈值
|
||||||
confThresh := 0.25
|
confThresh := 0.25
|
||||||
if origW < 200 || origH < 100 {
|
if origW < 300 || origH < 150 {
|
||||||
confThresh = 0.1 // 小图使用更低阈值
|
confThresh = 0.05 // 小图使用更低阈值
|
||||||
}
|
}
|
||||||
detections := postprocessYOLO(output, origW, origH, confThresh, 0.45)
|
detections := postprocessYOLO(output, origW, origH, confThresh, 0.45)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user