dataset_utils.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:tf_datasets 作者: tmattio 项目源码 文件源码
def __init__(self):
    # Create a single Session to run all image coding calls.
    self._sess = tf.Session()

    # Initializes function that converts PNG to JPEG data.
    self._png_data = tf.placeholder(dtype=tf.string)
    self._decode_png = tf.image.decode_png(self._png_data, channels=3)

    # Initializes function that decodes RGB JPEG data.
    self._jpeg_data = tf.placeholder(dtype=tf.string)
    self._decode_jpeg = tf.image.decode_jpeg(self._jpeg_data, channels=3)

    # Initializes function that encode RGB JPEG/PNG data.
    self._image = tf.placeholder(dtype=tf.uint8)
    self._encoded_png = tf.image.encode_png(self._image)
    self._encoded_jpeg = tf.image.encode_jpeg(self._image)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号