-
Notifications
You must be signed in to change notification settings - Fork 279
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 WebP image format support #43
Conversation
5bad7aa
to
8d96780
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small comments. Otherwise LGTM.
from tensorflow.python.platform import resource_loader | ||
|
||
|
||
class ImageDtasetTest(test.TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: ImageDatasetTest
|
||
class ImageDtasetTest(test.TestCase): | ||
|
||
def test_sequence_file_dataset(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: update the function name
config.output.colorspace = MODE_RGBA; | ||
int returned = DecodeWebP(reinterpret_cast<const uint8_t *>(data.c_str()), size, &config); | ||
Tensor value_tensor(ctx->allocator({}), DT_UINT8, {config.output.height, config.output.width, 4}); | ||
const uint64_t num_bytes = 4 * config.output.width * (uint64_t)config.output.height; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe move 4
to a constant
This PR is part of the efforts to support WebP image format. It adds WebP image format through tf.data API. This PR fixes 42 Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
to limit the log Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@terrytangyuan The PR has been updated with comments addressed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. LGTM now.
This PR is part of the efforts to support WebP image format.
It adds WebP image format through tf.data API.
This PR fixes #42
This PR is related to tensorflow/tensorflow#18250
Signed-off-by: Yong Tang yong.tang.github@outlook.com