Skip to content

Replacing PIL and OpenCV #1225

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ShahriarRezghi
Copy link
Contributor

This is the first part of our own image reading functions. This PR adds PNG reading functions using libpng. @fmassa what are your thoughts on these?

  • Right now the code is only reading RGB(and not RGBA). Should it stay this way?
  • We have two functions. is_png tells us weather the data is a PNG image or not. read_png reads the image and returns a torch::Tensor.
  • In case of failure the code returns an empty torch::Tensor.
  • How should the tests be? we can write the tests in C++ and compare the read image with OpenCV (or some other library) output (which is not good because it has OpenCV as a dependency). Or we can expose to Python and compare with PIL output.

@codecov-io
Copy link

codecov-io commented Aug 10, 2019

Codecov Report

Merging #1225 into master will decrease coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1225      +/-   ##
==========================================
- Coverage   65.64%   65.59%   -0.06%     
==========================================
  Files          74       74              
  Lines        5784     5784              
  Branches      884      884              
==========================================
- Hits         3797     3794       -3     
- Misses       1723     1725       +2     
- Partials      264      265       +1
Impacted Files Coverage Δ
torchvision/transforms/transforms.py 80.94% <0%> (-0.59%) ⬇️

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 8635be9...73c09aa. Read the comment docs.

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.

3 participants