Skip to content

Commit a78965f

Browse files
BebDongzhanghang1989
authored andcommitted
Update cityscapes.py (#987)
Fix the bug that when split is 'val' and mode is 'test', it returns a PIL.Image.Image object instead of NDArray.
1 parent 99a58dd commit a78965f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

gluoncv/data/cityscapes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def _class_to_index(self, mask):
4848
def __getitem__(self, index):
4949
img = Image.open(self.images[index]).convert('RGB')
5050
if self.mode == 'test':
51+
img = self._img_transform(img)
5152
if self.transform is not None:
5253
img = self.transform(img)
5354
return img, os.path.basename(self.images[index])

0 commit comments

Comments
 (0)