From 3bbc132359325e8475c3a35fcab52e17492e40e1 Mon Sep 17 00:00:00 2001 From: Laurent Fainsin Date: Wed, 7 Sep 2022 10:43:12 +0200 Subject: [PATCH] fix: augmentations Former-commit-id: d06568c40226cb9b2e4f80b4fe1dea1f094a5934 [formerly ecc833dfd23fc9065637e24de9b6ce94410f5c10] Former-commit-id: 70d75d9c26a3010618a5b6e42ca197d1917ef640 --- src/data/dataloader.py | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/data/dataloader.py b/src/data/dataloader.py index 3898ea5..bc3a8e7 100644 --- a/src/data/dataloader.py +++ b/src/data/dataloader.py @@ -19,18 +19,17 @@ class Spheres(pl.LightningDataModule): transforms = A.Compose( [ A.Flip(), - # A.ColorJitter(), - # A.ToGray(p=0.01), - # A.GaussianBlur(), - # A.MotionBlur(), - # A.ISONoise(), - # A.ImageCompression(), - # A.Normalize( - # mean=[0.485, 0.456, 0.406], - # std=[0.229, 0.224, 0.225], - # max_pixel_value=255, - # ), # [0, 255] -> coco (?) normalized - A.ToFloat(max_value=255), + A.ColorJitter(), + A.ToGray(p=0.01), + A.GaussianBlur(), + A.MotionBlur(), + A.ISONoise(), + A.ImageCompression(), + A.Normalize( + mean=[0.485, 0.456, 0.406], + std=[0.229, 0.224, 0.225], + max_pixel_value=255, + ), # [0, 255] -> coco (?) normalized ToTensorV2(), # HWC -> CHW ], bbox_params=A.BboxParams( @@ -57,12 +56,11 @@ class Spheres(pl.LightningDataModule): def val_dataloader(self): transforms = A.Compose( [ - # A.Normalize( - # mean=[0.485, 0.456, 0.406], - # std=[0.229, 0.224, 0.225], - # max_pixel_value=255, - # ), # [0, 255] -> [0.0, 1.0] normalized - A.ToFloat(max_value=255), + A.Normalize( + mean=[0.485, 0.456, 0.406], + std=[0.229, 0.224, 0.225], + max_pixel_value=255, + ), # [0, 255] -> [0.0, 1.0] normalized ToTensorV2(), # HWC -> CHW ], bbox_params=A.BboxParams(