serving icon indicating copy to clipboard operation
serving copied to clipboard

How to return image in tensorflow serving?

Open rohanmuplara opened this issue 2 years ago • 0 comments

What is the best way to return an image in tensorflow serving? I imagine it is something such as tf.encode_png or tf.encode_jpeg but those are causing me problems I am trying to write a tensor to a png. As seen in colab link at 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.wrte_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

rohanmuplara avatar Apr 18 '22 13:04 rohanmuplara