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

Apply transform in FilePathDataset #97

Merged
merged 3 commits into from
Feb 10, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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