fusion-classify.py 文件源码

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

项目:toothless 作者: ratt-ru 项目源码 文件源码
def load_image(path, height, width, mode='RGB'):
    """
    Load an image from disk

    Returns an np.ndarray (channels x width x height)

    Arguments:
    path -- path to an image on disk
    width -- resize dimension
    height -- resize dimension

    Keyword arguments:
    mode -- the PIL mode that the image should be converted to
        (RGB for color or L for grayscale)
    """

    image = PIL.Image.open(path)
    image = image.convert(mode)
    image = np.array(image)
    # squash
    image = scipy.misc.imresize(image, (height, width), 'bilinear')
    return image

# Forward pass of input through the network
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号