def _decode(self, image_buffer):
"""Decodes the image buffer.
Args:
image_buffer: The tensor representing the encoded image tensor.
Returns:
A tensor that represents decoded image of self._shape, or
(?, ?, self._channels) if self._shape is not specified.
"""
def decode_raw():
"""Decodes a raw image."""
return tf.decode_raw(image_buffer, out_type=self._dtype)
image = decode_raw()
# image.set_shape([None, None, self._channels])
if self._shape is not None:
image = tf.reshape(image, self._shape)
return image
评论列表
文章目录