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 version of readPngImage... that writes into an existing Tensor #2358

Closed
nickgg opened this issue Feb 6, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@nickgg
Copy link
Contributor

commented Feb 6, 2019

The Image reading functions (lib/Base/Image.h) either take a Tensor* and reset it to the dimensions of the image, or in the case of readPngImageAndPreprocess create a new Tensor. This means that when loading a batch of images that should go into the same Tensor we do unnecessary copies.

Write a version of readImage (andPreprocess?) which takes a four dimensional tensor (w/ an index) and writes into it. The input tensor must have the same dimensions as the image.

@nickgg nickgg self-assigned this Apr 26, 2019

@ZchiPitt ZchiPitt self-assigned this May 8, 2019

facebook-github-bot added a commit that referenced this issue May 16, 2019

Add a version for readPngImageAndPreprocess that can also take a tens…
…or as input. (#2896)

Summary:
*Description*:
Implement a version for readPngImageAndPreprocess that can also take a tensor as input.
*Testing*:
Add a test case in ImageTest: readPngImageAndPreprocessWithAndWithoutInputTensor() that verifies the new version works correctly.
[Optional Fixes #issue]
#2358
Pull Request resolved: #2896

Differential Revision: D15343817

Pulled By: ZchiPitt

fbshipit-source-id: c010e08190fe4625bc9d4484dd1b89c1437cf5c3

@ZchiPitt ZchiPitt closed this May 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.