From c775a296a7db2e523a230b2a0900ecd12845ecde Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 26 Jul 2022 19:00:48 +0200 Subject: [PATCH] Revert "Fix BGR->RGB Bug in albumentations #8641" (#8727) Revert "Fix BGR->RGB Bug in albumentations #8641 (#8695)" This reverts commit 2e1291fdce26b3cff213e9e7ee8c196fa263b688. --- utils/augmentations.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/augmentations.py b/utils/augmentations.py index 97506ae..3f764c0 100644 --- a/utils/augmentations.py +++ b/utils/augmentations.py @@ -39,9 +39,8 @@ class Albumentations: def __call__(self, im, labels, p=1.0): if self.transform and random.random() < p: - new = self.transform(image=im[..., ::-1], bboxes=labels[:, 1:], class_labels=labels[:, 0]) # transformed - im = new['image'][..., ::-1] # RGB to BGR - labels = np.array([[c, *b] for c, b in zip(new['class_labels'], new['bboxes'])]) + new = self.transform(image=im, bboxes=labels[:, 1:], class_labels=labels[:, 0]) # transformed + im, labels = new['image'], np.array([[c, *b] for c, b in zip(new['class_labels'], new['bboxes'])]) return im, labels