From fc9cf5546ff958778a874ae518d32e4a27dd31ca Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Sat, 14 Mar 2026 14:53:27 +0800 Subject: [PATCH] Fix bbox mapping for internal yolo resize --- plugins/ai_yolo/ai_yolo_node.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/ai_yolo/ai_yolo_node.cpp b/plugins/ai_yolo/ai_yolo_node.cpp index 8b5ed0e..f1fb476 100644 --- a/plugins/ai_yolo/ai_yolo_node.cpp +++ b/plugins/ai_yolo/ai_yolo_node.cpp @@ -73,7 +73,10 @@ DetCoordContext BuildDetCoordContext(const Frame& frame, int model_input_w, int ctx.out_w = frame.width; ctx.out_h = frame.height; - if (frame.transform_meta && frame.transform_meta->valid && + const bool infer_input_matches_frame = (frame.width == model_input_w && frame.height == model_input_h); + + if (infer_input_matches_frame && + frame.transform_meta && frame.transform_meta->valid && frame.transform_meta->src_w > 0 && frame.transform_meta->src_h > 0 && frame.transform_meta->scale_x > 1e-6f && frame.transform_meta->scale_y > 1e-6f) { ctx.has_transform = true;