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

Improved utilites, adds examples, tests #3594

Merged
merged 24 commits into from
Mar 30, 2021
Merged

Conversation

oke-aditya
Copy link
Contributor

@oke-aditya oke-aditya commented Mar 22, 2021

Fixes #3364 Fixes #3449.

Follow up of plotting utils #3330 #2785 #3296

  • Add Test to check modifications are not in place.
  • Add return type for all.
  • Bump codecov of utils.
  • Add GitHub gist notebook for all plotting utils. Show a demonstration with torchvision models.
  • Add Colab link.
  • Add note in Readme.

I'm still not sure how we should handle single-channel images.

@oke-aditya oke-aditya marked this pull request as draft March 22, 2021 16:53
@oke-aditya
Copy link
Contributor Author

oke-aditya commented Mar 24, 2021

Almost there!

Since we modified utils.make_grid() I rewrote docs for make_grid.

I am adding this to the examples folder, not as anonymous gist.

The advantage is that this can be version controlled as well as modified by anyone with a simple PR!

This is still WIP, but open for reviews!

@datumbox I remember getting nice output on persons. See here!

Can we use this image for showing the segmentation masks demonstration? It would be really nice.

Edit: I'm currently using a sample COCO image which was also used in DETR Colab demo. It too looks nice.
But I'm not sure of copyright issues (if we are allowed to use this image).

@oke-aditya oke-aditya marked this pull request as ready for review March 24, 2021 17:44
@oke-aditya oke-aditya changed the title [WIP] Improved utilites, adds examples, tests Improved utilites, adds examples, tests Mar 26, 2021
@oke-aditya
Copy link
Contributor Author

oke-aditya commented Mar 26, 2021

Feel free to review the PR!

Here is a link to the rendered notebook.

For bounding boxes, let me know if I should change the image to image as used in segmentations.
Maybe the detection output would be better.

The tests just improve code coverage, I have just added corner cases of errors and some lines which weren't tested earlier.

cc @fmassa @pmeier

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.

Looks great, thanks!

@codecov
Copy link

codecov bot commented Mar 30, 2021

Codecov Report

Merging #3594 (3ba8d21) into master (20a771e) will increase coverage by 0.36%.
The diff coverage is 100.00%.

❗ Current head 3ba8d21 differs from pull request most recent head feb6fd2. Consider uploading reports for the commit feb6fd2 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3594      +/-   ##
==========================================
+ Coverage   79.33%   79.69%   +0.36%     
==========================================
  Files         105      105              
  Lines        9822     9822              
  Branches     1582     1582              
==========================================
+ Hits         7792     7828      +36     
+ Misses       1538     1517      -21     
+ Partials      492      477      -15     
Impacted Files Coverage Δ
torchvision/utils.py 79.03% <100.00%> (+16.93%) ⬆️
torchvision/transforms/functional_tensor.py 79.84% <0.00%> (+0.56%) ⬆️
torchvision/datasets/folder.py 78.57% <0.00%> (+1.02%) ⬆️
torchvision/models/detection/anchor_utils.py 94.66% <0.00%> (+1.33%) ⬆️
torchvision/ops/deform_conv.py 72.30% <0.00%> (+3.07%) ⬆️
torchvision/extension.py 67.21% <0.00%> (+13.11%) ⬆️

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 20a771e...feb6fd2. Read the comment docs.

@fmassa fmassa merged commit 66d777e into pytorch:master Mar 30, 2021
@oke-aditya oke-aditya deleted the updt_utls branch March 30, 2021 14:31
facebook-github-bot pushed a commit that referenced this pull request Apr 2, 2021
Summary:
* start adding tests

* add return type and doc

* adds tests

* add no fill tests

* add rgb test

* check inplace

* bug fix

* bug fix

* rewrite make grid

* add plotting demos

* rename file

* remove

* updt

* Add viz

* updt

* update readme, add links

* complte bounding boxes

* Complete the examples!

* link fix

* link fixed

Reviewed By: fmassa

Differential Revision: D27433916

fbshipit-source-id: 144ca18f9d444b8c78141f2f7ae2f8077ab45076

Co-authored-by: Francisco Massa <[email protected]>
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.

[docs] Usage example missing for torchvision.utils.draw_bounding_boxes Improve utilites
5 participants