Skip to content

Commit e37323d

Browse files
authored
Merge pull request #1 from fmassa/coco_tfix
Minor fix in COCO dataset
2 parents 9378feb + 0332624 commit e37323d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

torchvision/datasets/coco.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ def __getitem__(self, index):
5151
path = coco.loadImgs(img_id)[0]['file_name']
5252

5353
img = Image.open(os.path.join(self.root, path)).convert('RGB')
54+
if self.transform is not None:
55+
img = self.transform(img)
56+
5457
if self.target_transform is not None:
5558
target = self.target_transform(target)
5659

0 commit comments

Comments
 (0)