Skip to content

Commit

Permalink
Merge pull request #1 from fmassa/coco_tfix
Browse files Browse the repository at this point in the history
Minor fix in COCO dataset
  • Loading branch information
soumith authored Nov 10, 2016
2 parents 9378feb + 0332624 commit e37323d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions torchvision/datasets/coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ def __getitem__(self, index):
path = coco.loadImgs(img_id)[0]['file_name']

img = Image.open(os.path.join(self.root, path)).convert('RGB')
if self.transform is not None:
img = self.transform(img)

if self.target_transform is not None:
target = self.target_transform(target)

Expand Down

0 comments on commit e37323d

Please sign in to comment.