glenn-jocher commited on
Commit
c775a29
·
unverified ·
1 Parent(s): d5116bb

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

Browse files

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

This reverts commit 2e1291fdce26b3cff213e9e7ee8c196fa263b688.

Files changed (1) hide show
  1. utils/augmentations.py +2 -3
utils/augmentations.py CHANGED
@@ -39,9 +39,8 @@ class Albumentations:
39
 
40
  def __call__(self, im, labels, p=1.0):
41
  if self.transform and random.random() < p:
42
- new = self.transform(image=im[..., ::-1], bboxes=labels[:, 1:], class_labels=labels[:, 0]) # transformed
43
- im = new['image'][..., ::-1] # RGB to BGR
44
- labels = np.array([[c, *b] for c, b in zip(new['class_labels'], new['bboxes'])])
45
  return im, labels
46
 
47
 
 
39
 
40
  def __call__(self, im, labels, p=1.0):
41
  if self.transform and random.random() < p:
42
+ new = self.transform(image=im, bboxes=labels[:, 1:], class_labels=labels[:, 0]) # transformed
43
+ im, labels = new['image'], np.array([[c, *b] for c, b in zip(new['class_labels'], new['bboxes'])])
 
44
  return im, labels
45
 
46