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 decode_image op #2718

Merged
merged 4 commits into from
Sep 28, 2020
Merged

Add decode_image op #2718

merged 4 commits into from
Sep 28, 2020

Conversation

fmassa
Copy link
Member

@fmassa fmassa commented Sep 28, 2020

Fixes #2686

For a follow-up PR, I'm thinking about removing read_jpeg / read_png (and potentially read_image) because they are now just wrappers around _read_file + decode*. I'll also move _read_file to C++, so that all ops can be torchscriptable.

The implementation in read_image_cpu.cpp can definitely be improved, but this is just a first version to get things moving forward.

@fmassa fmassa requested a review from andfoy September 28, 2020 12:53
@codecov
Copy link

codecov bot commented Sep 28, 2020

Codecov Report

Merging #2718 into master will increase coverage by 0.03%.
The diff coverage is 62.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2718      +/-   ##
==========================================
+ Coverage   72.87%   72.91%   +0.03%     
==========================================
  Files          95       95              
  Lines        8237     8233       -4     
  Branches     1285     1279       -6     
==========================================
  Hits         6003     6003              
+ Misses       1839     1838       -1     
+ Partials      395      392       -3     
Impacted Files Coverage Δ
torchvision/io/image.py 78.00% <62.50%> (+5.77%) ⬆️

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 9e7a4b1...5f9acc4. Read the comment docs.

Copy link
Contributor

@andfoy andfoy left a comment

Choose a reason for hiding this comment

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

LGTM!

@fmassa fmassa merged commit 6afb349 into pytorch:master Sep 28, 2020
@fmassa fmassa deleted the decode_image branch September 28, 2020 19:20
bryant1410 pushed a commit to bryant1410/vision-1 that referenced this pull request Nov 22, 2020
* Add decode_image op

* Fix lint

* More lint

* Add C10_EXPORT
vfdev-5 pushed a commit to Quansight/vision that referenced this pull request Dec 4, 2020
* Add decode_image op

* Fix lint

* More lint

* Add C10_EXPORT
@prclibo
Copy link

prclibo commented Dec 19, 2020

Hello. Thanks for adding this functionality. Just a quick question: would there be any plan for a GPU implementation for this op?

@fmassa
Copy link
Member Author

fmassa commented Jan 20, 2021

@prclibo yes, we are planning on adding GPU support for JPEG images, see #2786 for the PR implementing this (which will be merged for the next release)

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.

Provide generic decode/read image io functions
3 participants