From 2c7262bfb1c09d4e6a196354936098c090d1748c Mon Sep 17 00:00:00 2001 From: Ibraheem Muhammad Moosa <45825930+ibraheemmmoosa@users.noreply.github.com> Date: Wed, 10 Feb 2021 10:08:46 +0600 Subject: [PATCH] Apply transform in FilePathDataset Transforms were not applied to image in FilePathDataset. --- flash/vision/classification/data.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flash/vision/classification/data.py b/flash/vision/classification/data.py index 4080909c14..d5bde69ef1 100644 --- a/flash/vision/classification/data.py +++ b/flash/vision/classification/data.py @@ -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]