阅读(3406) (0)

TensorFlow函数教程:tf.io.decode_gif

2019-02-22 15:01:33 更新

tf.io.decode_gif函数

别名:

  • tf.image.decode_gif
  • tf.io.decode_gif
tf.io.decode_gif(
    contents,
    name=None
)

将GIF编码图像的第一帧解码为uint8张量。

不支持使用框架或透明度压缩的GIF将动画GIF从压缩转换为未压缩:

convert $src.gif -coalesce $dst.gif

此操作还支持解码JPEG和PNG,但使用tf.image.decode_image更简洁。

参数:

  • contents:string类型的0-d Tensor。GIF编码的图像。
  • name:操作的名称(可选)。

返回:

uint8类型的Tensor。