Tensorflow Machine Learning: No Decoder for TIFF Images?

烈酒焚心 提交于 2019-12-04 01:22:40

问题


I have noticed the Tensorflow Python package provides standard procedures for decoding jpeg, png and gif images after reading files. For instance for png:

import tensorflow as tf
filename_queue = tf.train.string_input_producer(['/Image.png']) #  list of files to read
reader = tf.WholeFileReader()    
key, value = reader.read(filename_queue)
decoded_image = tf.image.decode_png(value) # use png or jpg decoder based on your files.

However, the tiff format decoder seems to be missing.

So what solutions exist for tiff files? Surely, I could convert my input images to png, but this doesn't seem to be a very smart solution.


回答1:


Correct, there's no decoder for TIFF images. Look in tensorflow/core/kernels and you see

decode_csv_op.cc
decode_gif_op.cc
decode_jpeg_op.cc
decode_png_op.cc
decode_raw_op.cc

No decode_tiff_op.cc. This could be a good target for community contribution.



来源:https://stackoverflow.com/questions/41985509/tensorflow-machine-learning-no-decoder-for-tiff-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!