utils.py 文件源码

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

项目:Dual-Attention-Network 作者: changywtw 项目源码 文件源码
def load_image2(path, height=None, width=None):
    # load image
    img = skimage.io.imread(path)
    img = img / 255.0
    if height is not None and width is not None:
        ny = height
        nx = width
    elif height is not None:
        ny = height
        nx = img.shape[1] * ny / img.shape[0]
    elif width is not None:
        nx = width
        ny = img.shape[0] * nx / img.shape[1]
    else:
        ny = img.shape[0]
        nx = img.shape[1]
    return skimage.transform.resize(img, (ny, nx))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号