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

Update docstings and expose main image io functions in the vision docs #2760

Merged
merged 5 commits into from
Oct 6, 2020

Conversation

andfoy
Copy link
Contributor

@andfoy andfoy commented Oct 6, 2020

This PR exposes the main encoding/reading and decoding/writing functions for the image backend:

  • read_image
  • decode_image
  • encode_jpeg
  • write_jpeg
  • encode_png
  • write_png

@andfoy andfoy self-assigned this Oct 6, 2020
@codecov
Copy link

codecov bot commented Oct 6, 2020

Codecov Report

Merging #2760 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2760   +/-   ##
=======================================
  Coverage   73.09%   73.09%           
=======================================
  Files          96       96           
  Lines        8321     8322    +1     
  Branches     1295     1295           
=======================================
+ Hits         6082     6083    +1     
  Misses       1840     1840           
  Partials      399      399           
Impacted Files Coverage Δ
torchvision/io/image.py 80.00% <ø> (ø)
torchvision/io/__init__.py 100.00% <100.00%> (ø)

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 217e26f...aff0702. Read the comment docs.

@fmassa
Copy link
Member

fmassa commented Oct 6, 2020

@andfoy thanks for the PR!

FYI we will be removing read_jpeg and read_png before the release (and instead let the user use read_image only).

I'll be sending a follow-up PR removing those

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.

Good to go, but I'll be removing read_png and read_jpeg in a follow-up PR

@andfoy
Copy link
Contributor Author

andfoy commented Oct 6, 2020

Should we do something similar for the encode function? Let users to pass a format argument?

@fmassa fmassa merged commit de90862 into pytorch:master Oct 6, 2020
@andfoy andfoy deleted the expose_image_docs branch October 6, 2020 15:31
@fmassa
Copy link
Member

fmassa commented Oct 6, 2020

Should we do something similar for the encode function? Let users to pass a format argument?

I'm ok for now letting it be explicit via separate functions, otherwise we would need to do some more extra work just before the release (different kwargs for different functions, and kwargs don't work with torchscript).

@fmassa
Copy link
Member

fmassa commented Oct 6, 2020

I would though consider factoring out the saving part from write_png / write_jpeg so that we have a custom function just for writing a file, similar to read_file but for writing, a la write_file.

@fmassa
Copy link
Member

fmassa commented Oct 6, 2020

FYI I'm working on implementing a write_file.

bryant1410 pushed a commit to bryant1410/vision-1 that referenced this pull request Nov 22, 2020
pytorch#2760)

* Expose image io functions in docs

* Expose image funcs in module

* Update docstring

* Update docstrings for all functions

* Update section header
vfdev-5 pushed a commit to Quansight/vision that referenced this pull request Dec 4, 2020
pytorch#2760)

* Expose image io functions in docs

* Expose image funcs in module

* Update docstring

* Update docstrings for all functions

* Update section header
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