Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Apply transform in FilePathDataset (#97)
Browse files Browse the repository at this point in the history
Co-authored-by: Teddy Koker <[email protected]>
Co-authored-by: Kaushik B <[email protected]>
  • Loading branch information
3 people authored Feb 10, 2021
1 parent 6c047f0 commit 7acd8b5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flash/vision/classification/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def __len__(self) -> int:
def __getitem__(self, index: int) -> Tuple[Any, Optional[int]]:
filename = self.fnames[index]
img = self.loader(filename)
if self.transform is not None:
img = self.transform(img)
label = None
if self.has_labels:
label = self.labels[index]
Expand Down

0 comments on commit 7acd8b5

Please sign in to comment.