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;