misc.py 文件源码

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

项目:evaluation-toolkit 作者: lightfield-analysis 项目源码 文件源码
def resize_to_shape(data, height, width, order=1):
    h, w = np.shape(data)[0:2]
    factor_h = height / float(h)
    factor_w = width / float(w)
    if len(np.shape(data)) == 3:
        scale_factor = [factor_h, factor_w, 1.0]
    else:
        scale_factor = [factor_h, factor_w]
    return sci.zoom(data, scale_factor, order=order)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号