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 WebP image format support #43

Merged
merged 7 commits into from
Jan 6, 2019
Merged

Add WebP image format support #43

merged 7 commits into from
Jan 6, 2019

Conversation

yongtang
Copy link
Member

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

Copy link
Member

@terrytangyuan terrytangyuan left a 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):
Copy link
Member

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):
Copy link
Member

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;
Copy link
Member

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>
@yongtang
Copy link
Member Author

yongtang commented Jan 6, 2019

@terrytangyuan The PR has been updated with comments addressed.

Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

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

Thanks. LGTM now.

@yongtang yongtang merged commit 2954f9c into tensorflow:master Jan 6, 2019
@yongtang yongtang deleted the webp branch January 6, 2019 23:47
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.

Support WebP for tensorflow-io
2 participants