image_reader.py 文件源码

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

项目:tf_base 作者: ozansener 项目源码 文件源码
def process_single_image(img, scale, crop, mean):
    """
    Processing an image for zero-mean/std-dev fix etc
    """
    new_shape = tf.pack([scale, scale])
    img = tf.image.resize_images(img, new_shape[0], new_shape[1])
    offset = (new_shape - crop) / 2
    img = tf.slice(img, begin=tf.pack([offset[0], offset[1], 0]), size=tf.pack([crop, crop, -1]))
    return tf.to_float(img) - mean
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号