Fix bbox mapping for internal yolo resize

This commit is contained in:
tian 2026-03-14 14:53:27 +08:00
parent cdc3c46932
commit fc9cf5546f

View File

@ -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;