Fix labels padding for Letterbox with center=False (#17728)

This commit is contained in:
Mohammed Yasin 2024-11-25 00:01:11 +08:00 committed by GitHub
parent 426879d80d
commit 29361e46d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1591,7 +1591,7 @@ class LetterBox:
labels["ratio_pad"] = (labels["ratio_pad"], (left, top)) # for evaluation labels["ratio_pad"] = (labels["ratio_pad"], (left, top)) # for evaluation
if len(labels): if len(labels):
labels = self._update_labels(labels, ratio, dw, dh) labels = self._update_labels(labels, ratio, left, top)
labels["img"] = img labels["img"] = img
labels["resized_shape"] = new_shape labels["resized_shape"] = new_shape
return labels return labels