Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transformers_as_arg #22

Merged
merged 5 commits into from
Oct 4, 2024
Merged

transformers_as_arg #22

merged 5 commits into from
Oct 4, 2024

Conversation

MarjanAsgari
Copy link
Contributor

No description provided.

Comment on lines 104 to 118
if transformer_flip and not transformer_rotate:
transforms = tta.Compose(
[
tta.HorizontalFlip(),
tta.VerticalFlip(),
]
)
elif not transformer_flip and transformer_rotate:
transforms = tta.Compose(
[
tta.Rotate90(angles=[90]),
]
)
elif transformer_flip and transformer_rotate:
transforms = tta.aliases.d4_transform()
Copy link
Collaborator

@jfbourgon jfbourgon Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the following could be more readable:

if transformer_flip and transformer_rotate:    # do all
    transforms = tta.aliases.d4_transform()
elif transformer_rotate:                       # do rotate only
    transforms = tta.Compose(
        [
            tta.Rotate90(angles=[90]),
        ]
    )
elif transformer_flip:                         # do flip only
     transforms = tta.Compose(
        [
            tta.HorizontalFlip(),
            tta.VerticalFlip(),
        ]
    )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! I'll change it and push it now

@mpelchat04 mpelchat04 merged commit 0fb5766 into NRCan:main Oct 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants