Skip to content

Commit

Permalink
Update cityscapes.py (#987)
Browse files Browse the repository at this point in the history
Fix the bug that when split is 'val' and mode is 'test', it returns a PIL.Image.Image object instead of NDArray.
  • Loading branch information
BebDong authored and zhanghang1989 committed Oct 17, 2019
1 parent 99a58dd commit a78965f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions gluoncv/data/cityscapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def _class_to_index(self, mask):
def __getitem__(self, index):
img = Image.open(self.images[index]).convert('RGB')
if self.mode == 'test':
img = self._img_transform(img)
if self.transform is not None:
img = self.transform(img)
return img, os.path.basename(self.images[index])
Expand Down

0 comments on commit a78965f

Please sign in to comment.