Commit a9b89567 authored by vfdev's avatar vfdev Committed by Yuxin Wu

Fix AssertionError with repr on AugmentorList (#675)

* Fix AssertionError with repr on AugmentorList

* Use 'augmentors' instead of 'augs'
parent 7af96dea
...@@ -135,7 +135,7 @@ class AugmentorList(ImageAugmentor): ...@@ -135,7 +135,7 @@ class AugmentorList(ImageAugmentor):
Args: Args:
augmentors (list): list of :class:`ImageAugmentor` instance to be applied. augmentors (list): list of :class:`ImageAugmentor` instance to be applied.
""" """
self.augs = augmentors self.augmentors = augmentors
super(AugmentorList, self).__init__() super(AugmentorList, self).__init__()
def _get_augment_params(self, img): def _get_augment_params(self, img):
...@@ -147,7 +147,7 @@ class AugmentorList(ImageAugmentor): ...@@ -147,7 +147,7 @@ class AugmentorList(ImageAugmentor):
assert img.ndim in [2, 3], img.ndim assert img.ndim in [2, 3], img.ndim
prms = [] prms = []
for a in self.augs: for a in self.augmentors:
img, prm = a._augment_return_params(img) img, prm = a._augment_return_params(img)
prms.append(prm) prms.append(prm)
return img, prms return img, prms
...@@ -155,16 +155,16 @@ class AugmentorList(ImageAugmentor): ...@@ -155,16 +155,16 @@ class AugmentorList(ImageAugmentor):
def _augment(self, img, param): def _augment(self, img, param):
check_dtype(img) check_dtype(img)
assert img.ndim in [2, 3], img.ndim assert img.ndim in [2, 3], img.ndim
for aug, prm in zip(self.augs, param): for aug, prm in zip(self.augmentors, param):
img = aug._augment(img, prm) img = aug._augment(img, prm)
return img return img
def _augment_coords(self, coords, param): def _augment_coords(self, coords, param):
for aug, prm in zip(self.augs, param): for aug, prm in zip(self.augmentors, param):
coords = aug._augment_coords(coords, prm) coords = aug._augment_coords(coords, prm)
return coords return coords
def reset_state(self): def reset_state(self):
""" Will reset state of each augmentor """ """ Will reset state of each augmentor """
for a in self.augs: for a in self.augmentors:
a.reset_state() a.reset_state()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment