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

Add helper decorator to preserve shape of input image #106

Merged
merged 6 commits into from
Oct 22, 2018
Merged

Add helper decorator to preserve shape of input image #106

merged 6 commits into from
Oct 22, 2018

Conversation

BloodAxe
Copy link
Contributor

@BloodAxe BloodAxe commented Oct 19, 2018

Fixes #104

Important notice
Although this PR fixes reported issue, it's kinda introduces a breaking change. So I think it's a good idea to include a 'Breaking changes' section in a release notes for next release:

  • Shape of input tensors will be not changes as long as it's not required by transformation itself (Dummy dimensions will not be squeezed).

@BloodAxe BloodAxe changed the title Add helper decorator to preserver shape of input image Add helper decorator to preserve shape of input image Oct 19, 2018
@BloodAxe BloodAxe requested review from albu, ternaus and creafz October 20, 2018 15:34
@ternaus
Copy link
Collaborator

ternaus commented Oct 20, 2018

👍

@albu
Copy link
Contributor

albu commented Oct 21, 2018

Does it do nothing if shape is already fine? It's important to check this to not degrade speed.

@BloodAxe
Copy link
Contributor Author

Reshape operation does not move memory, so it's a zero-cost op. Benchmarks on mine PC (keras commented for purpose)

                 albumentations imgaug torchvision keras
RandomCrop64             951791      -       89839     -
PadToSize512               7447      -         466     -
HorizontalFlip             1691   1292        7780     -
VerticalFlip              16789   5490       11992     -
Rotate                     1632   1013         273     -
ShiftScaleRotate           2812   1338         232     -
Brightness                  354    331         681     -
ShiftHSV                    252    148          92     -
ShiftRGB                    415    407           -     -
Gamma                      1465      -        2100     -
Grayscale                  2204    520        1370     -

@BloodAxe BloodAxe merged commit 64be33d into albumentations-team:master Oct 22, 2018
@BloodAxe BloodAxe deleted the bugfix/shape-reserve branch October 22, 2018 19:34
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.

Target shape squeeze
4 participants