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

Refactor adjust ops tests #2595

Merged
merged 11 commits into from
Sep 1, 2020

Conversation

vfdev-5
Copy link
Collaborator

@vfdev-5 vfdev-5 commented Aug 18, 2020

Description:

Currently test_adjustments test mixes functional and transform tests for 3 color ops: adjust_brightness, adjust_contrast and adjust_saturation.

This PR solves the following problems:

  • difficulty to trace which function fails if the test is failing.
  • parameters are chosen randomly instead of checking inside well-defined interval
  • checking of dtype is done in a random way instead of deterministic one

Notes:

vfdev-5 added 6 commits July 2, 2020 19:49
- deprecated F.to_grayscale in favor of F.rgb_to_grayscale
- split test_adjustments into 3 separate tests
- unified testing approach with test_adjust_gamma
@codecov
Copy link

codecov bot commented Aug 18, 2020

Codecov Report

Merging #2595 into master will increase coverage by 1.34%.
The diff coverage is 71.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2595      +/-   ##
==========================================
+ Coverage   70.34%   71.68%   +1.34%     
==========================================
  Files          95       94       -1     
  Lines        8245     8162      -83     
  Branches     1308     1298      -10     
==========================================
+ Hits         5800     5851      +51     
+ Misses       2022     1901     -121     
+ Partials      423      410      -13     
Impacted Files Coverage Δ
torchvision/transforms/functional_tensor.py 63.66% <61.53%> (+1.46%) ⬆️
torchvision/transforms/functional_pil.py 66.98% <65.21%> (-0.17%) ⬇️
torchvision/transforms/functional.py 81.15% <81.81%> (-0.40%) ⬇️
torchvision/transforms/transforms.py 76.05% <100.00%> (-0.33%) ⬇️
torchvision/datasets/vision.py 48.27% <0.00%> (-15.52%) ⬇️
torchvision/datasets/utils.py 58.53% <0.00%> (-6.10%) ⬇️
torchvision/ops/deform_conv.py 66.66% <0.00%> (-3.34%) ⬇️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 497744b...ff2df55. Read the comment docs.

Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

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

Thanks for the PR Victor!

test/test_functional_tensor.py Outdated Show resolved Hide resolved
@vfdev-5 vfdev-5 requested a review from fmassa August 31, 2020 22:23
Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

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

Thanks!

@fmassa fmassa merged commit 5f616a2 into pytorch:master Sep 1, 2020
bryant1410 pushed a commit to bryant1410/vision-1 that referenced this pull request Nov 22, 2020
* [WIP] Unify ops Grayscale and RandomGrayscale

* Unified inputs for grayscale op and transforms
- deprecated F.to_grayscale in favor of F.rgb_to_grayscale

* Fixes bug with fp input

* Rewritten adjust_* tests
- split test_adjustments into 3 separate tests
- unified testing approach with test_adjust_gamma

* Added ColorJitter tests

* Relaxed tolerance for functional adjust-* tests

* Removed wrong merge and commented code
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.

2 participants