cityscapes_input.py 文件源码

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

项目:squeezenet 作者: mtreml 项目源码 文件源码
def read_images_and_labels_from_disk(input_queue):
    """ Reads images and labels from disk and sets their shape

      Args:
        input_queue: created by slice_input_producer
    """
    image_contents = tf.read_file(input_queue[0])
    label_contents = tf.read_file(input_queue[1])
    image = tf.image.decode_png(image_contents, IMAGE_CHANNELS)
    label = tf.image.decode_png(label_contents, LABEL_CHANNELS)
    image.set_shape([IMAGE_HEIGHT_ORIG, IMAGE_WIDTH_ORIG, IMAGE_CHANNELS])
    label.set_shape([IMAGE_HEIGHT_ORIG, IMAGE_WIDTH_ORIG, LABEL_CHANNELS])
    print("Image has dtype", image.dtype, "and shape", image.get_shape(), "after decoding from disk.")
    print("Label has dtype", label.dtype, "and shape", label.get_shape(), "after decoding from disk.")
    return image, label
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号