Skip to content

Commit

Permalink
Revert "Fix BGR->RGB Bug in albumentations ultralytics#8641" (ultraly…
Browse files Browse the repository at this point in the history
…tics#8727)

Revert "Fix BGR->RGB Bug in albumentations ultralytics#8641 (ultralytics#8695)"

This reverts commit 2e1291f.
  • Loading branch information
glenn-jocher authored and Clay Januhowski committed Sep 8, 2022
1 parent a6ae28f commit 467f18e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions utils/augmentations.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ def __init__(self):

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


Expand Down

0 comments on commit 467f18e

Please sign in to comment.