Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Update augmentation pipeline #458

Merged
merged 64 commits into from
Jun 1, 2021
Merged

Update augmentation pipeline #458

merged 64 commits into from
Jun 1, 2021

Conversation

melanibe
Copy link
Contributor

@melanibe melanibe commented May 12, 2021

This PR simplifies and generalizes the way we handle data augmentations:

  1. The pipelining logic is now taken care of by a ImageTransformPipeline class that takes as input a list of transforms to chain together. This pipeline takes of applying transforms on 3D or 2D images. The user can choose to apply the same transformation for all channels or whether to apply different transformation for each channel (if each channel represents a different modality / time point for example).
  2. The pipeline can now work directly with out of the box torchvision transform (as long as they support [..., C, H, W] inputs). This allows to get rid of nearly all of our custom augmentations functions.
  3. The conversion from pipeline of image transformation to ScalarItemAugmentation is now taken care of under the hood, the user does not need to call this wrapper for each config class. This avoids having to call with ImagePipeline wrapper and then again another wrapper.
  4. Getting rid of all the intrincated unused code for RandAugment & Co. The user has now instead complete freedom to specify the set of augmentations.

@melanibe melanibe changed the title Melanie/augmentation Update augmentation pipeline May 12, 2021
Tests/SSL/test_ssl_containers.py Outdated Show resolved Hide resolved
InnerEye/ML/dataset/scalar_dataset.py Outdated Show resolved Hide resolved
InnerEye/ML/augmentations/transform_pipeline.py Outdated Show resolved Hide resolved
InnerEye/ML/augmentations/transform_pipeline.py Outdated Show resolved Hide resolved
InnerEye/ML/augmentations/transform_pipeline.py Outdated Show resolved Hide resolved
Tests/ML/augmentations/test_image_transforms.py Outdated Show resolved Hide resolved
Tests/ML/augmentations/test_image_transforms.py Outdated Show resolved Hide resolved
Tests/ML/augmentations/test_transform_pipeline.py Outdated Show resolved Hide resolved
Tests/ML/augmentations/test_transform_pipeline.py Outdated Show resolved Hide resolved
docs/building_models.md Outdated Show resolved Hide resolved
@melanibe melanibe requested a review from ant0nsc May 24, 2021 14:51
ant0nsc
ant0nsc previously approved these changes May 24, 2021
@melanibe melanibe merged commit 51274c8 into main Jun 1, 2021
@melanibe melanibe deleted the melanie/augmentation branch June 1, 2021 08:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants