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

Fix augmentation space to be uint8 compatible #4806

Merged
merged 5 commits into from
Nov 1, 2021
Merged

Fix augmentation space to be uint8 compatible #4806

merged 5 commits into from
Nov 1, 2021

Conversation

jopo666
Copy link
Contributor

@jopo666 jopo666 commented Oct 31, 2021

A simple fix that addresses #4805.

cc @vfdev-5 @datumbox

@facebook-github-bot
Copy link

Hi @jopo666!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

facebook-github-bot commented Oct 31, 2021

💊 CI failures summary and remediations

As of commit 88d24fd (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@jopo666
Copy link
Contributor Author

jopo666 commented Oct 31, 2021

Maybe unit tests should also be extended to cover these types of bugs?

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Contributor

@datumbox datumbox left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing it.

Copy link
Contributor

@prabhat00155 prabhat00155 left a comment

Choose a reason for hiding this comment

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

Thanks @jopo666! Could you also perhaps add a unit test to cover this case?

@datumbox
Copy link
Contributor

datumbox commented Nov 1, 2021

@prabhat00155 What are your thoughts on testing this?

On the AutoAugmentation module we currently don't have any similar tests to check for misconfigurations of the methods and it's unclear how such a test would look like. One place we could potentially add it is on the implementation of solarize. For example we could add an assertion to ensure that the threshold is within bounds and then create a test to check the assertion is triggered:

inverted_img = invert(img)
return torch.where(img >= threshold, inverted_img, img)

Probably a similar assertion is worth to be added at posterize for the number of bits.

Finally I wonder if it's worth merging this so that we cover the bug and add the tests on a follow up PR. No strong opinions, just want to make sure this bug fix will be merged. :)

@prabhat00155
Copy link
Contributor

@prabhat00155 What are your thoughts on testing this?

On the AutoAugmentation module we currently don't have any similar tests to check for misconfigurations of the methods and it's unclear how such a test would look like. One place we could potentially add it is on the implementation of solarize. For example we could add an assertion to ensure that the threshold is within bounds and then create a test to check the assertion is triggered:

inverted_img = invert(img)
return torch.where(img >= threshold, inverted_img, img)

Probably a similar assertion is worth to be added at posterize for the number of bits.

Finally I wonder if it's worth merging this so that we cover the bug and add the tests on a follow up PR. No strong opinions, just want to make sure this bug fix will be merged. :)

Thanks @datumbox for the explanation. Makes sense to merge this PR then. We could look at adding tests in a follow-up PR.

@datumbox
Copy link
Contributor

datumbox commented Nov 1, 2021

@prabhat00155 Sounds great, thanks for the flexibility. I've created a ticket for this so that we don't forget: #4818

Feel free to merge on green CI.

@datumbox datumbox merged commit 00b963a into pytorch:main Nov 1, 2021
facebook-github-bot pushed a commit that referenced this pull request Nov 6, 2021
Summary:
* change range into uint8

* Same typo in TrivialAugmentWide and RandAugment

Reviewed By: kazhang

Differential Revision: D32216663

fbshipit-source-id: 9c654a7ef92a4f11092b77ac0a60fcb75b4607b9

Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
Co-authored-by: Prabhat Roy <prabhatroy@fb.com>
cyyever pushed a commit to cyyever/vision that referenced this pull request Nov 16, 2021
* change range into uint8

* Same typo in TrivialAugmentWide and RandAugment

Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
Co-authored-by: Prabhat Roy <prabhatroy@fb.com>
datumbox added a commit to datumbox/vision that referenced this pull request Dec 8, 2021
* change range into uint8

* Same typo in TrivialAugmentWide and RandAugment

Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
Co-authored-by: Prabhat Roy <prabhatroy@fb.com>
datumbox added a commit that referenced this pull request Dec 8, 2021
* change range into uint8

* Same typo in TrivialAugmentWide and RandAugment

Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
Co-authored-by: Prabhat Roy <prabhatroy@fb.com>

Co-authored-by: Jopo <49716607+jopo666@users.noreply.github.com>
Co-authored-by: Prabhat Roy <prabhatroy@fb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants