tutorial_inceptionV3_tfslim.py 文件源码

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

项目:tensorlayer-chinese 作者: shorxp 项目源码 文件源码
def load_image(path):
    # load image
    img = skimage.io.imread(path)
    img = img / 255.0
    assert (0 <= img).all() and (img <= 1.0).all()
    # print "Original Image Shape: ", img.shape
    # we crop image from center
    short_edge = min(img.shape[:2])
    yy = int((img.shape[0] - short_edge) / 2)
    xx = int((img.shape[1] - short_edge) / 2)
    crop_img = img[yy: yy + short_edge, xx: xx + short_edge]
    # resize to 299, 299
    resized_img = skimage.transform.resize(crop_img, (299, 299))
    return resized_img
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号