reader.py 文件源码

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

项目:monodepth360 作者: srijanparmeshwar 项目源码 文件源码
def read_file(filename, shape = None):
    if filename.lower().endswith(".exr"):
        depth_map = read_depth(filename)
        return depth_map, depth_map < 1000.0

    elif filename.lower().endswith(".png"):
        depth_map = mpimg.imread(filename)

        if shape is not None:
            ih, iw = depth_map.shape
            h, w = shape

            if ih > 1024:
                depth_map = depth_map[::2, ::2]

            depth_map = zoom(depth_map, [float(h) / float(ih), w / float(iw)], order = 1)

        mask = depth_map < 0.99
        depth_map = depth_map * 65536 / 1000
        return depth_map, mask

    elif filename.lower().endswith(".npy"):
        return np.load(filename), None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号