From 29361e46d99c5b27f812a94fdb9b7b7adc5a5c9b Mon Sep 17 00:00:00 2001 From: Mohammed Yasin <32206511+Y-T-G@users.noreply.github.com> Date: Mon, 25 Nov 2024 00:01:11 +0800 Subject: [PATCH] Fix labels padding for Letterbox with `center=False` (#17728) --- ultralytics/data/augment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ultralytics/data/augment.py b/ultralytics/data/augment.py index d092e3c370..bd821de28d 100644 --- a/ultralytics/data/augment.py +++ b/ultralytics/data/augment.py @@ -1591,7 +1591,7 @@ class LetterBox: labels["ratio_pad"] = (labels["ratio_pad"], (left, top)) # for evaluation if len(labels): - labels = self._update_labels(labels, ratio, dw, dh) + labels = self._update_labels(labels, ratio, left, top) labels["img"] = img labels["resized_shape"] = new_shape return labels