How to decode my tiff pictures to input tensorflow using pipline?

Viewed 3016

I am trying to train a neural network using my own tiff pictures with tensorflow pipline. Here is the problem: tensorflow only has 4 kinds of pictures which can be decoded(decode_jpeg, decode_bmp, decode_gif, decode_png), there is no way to decode tiff pictures. So, how can i decode my tiff pictures to use tensorflow pipline to input my own data? or how can i decode my tiff pictures to use batch?

1 Answers

Try this: tfio.experimental.image.decode_tiff.

tfio.experimental.image.decode_tiff(
    contents, index=0, name=None
)

contents: A Tensor of type string. 0-D. The TIFF-encoded image.

index: A Tensor of type int64. 0-D. The 0-based index of the frame inside TIFF-encoded image.

name: A name for the operation (optional).

Related