Difference between tf.encode_png or any image encoding versus traditional encoding

16 views
Skip to first unread message

rohan mahajan

unread,
Apr 18, 2022, 9:47:16 AMApr 18
to TensorFlow Developers
I am trying to write a tensor to a png. As seen in colab in bottom, when I take the encoded bytes and write it a file using python, it doesn't work. Trying opening the image it gets corrupted
When I use tf.io.write_file it works. I also tried taking a png and using tf.io_decode_png and than tf.io.encoding_png and the image string bytes differ from the original png. I am using tensorflow serving and using this png result through the rest api, where I don't have access to tf.io.write_file so I was wondering what encode_png does differently, than traditional png encodings.

https://www.loom.com/share/4b32b330a0e742cab2ea3a1a9af11b22
https://colab.research.google.com/drive/13Y4ET8jAHZDq7qwUYgg8nuBkxqniUqGu#scrollTo=IcXVZepnhkW4
Reply all
Reply to author
Forward
0 new messages