monodepth_model.py 文件源码

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

项目:monodepth360 作者: srijanparmeshwar 项目源码 文件源码
def disparity_to_depth(self, disparity, position, epsilon = 1e-6):
        baseline_distance = self.params.baseline
        S, T = lat_long_grid([tf.shape(disparity)[1], tf.shape(disparity)[2]])
        _, T_grids = self.expand_grids(S, -T, tf.shape(disparity)[0])
        if position == "top":
            t1 = tf.tan(T_grids)
            t2 = tf.tan(T_grids + np.pi * disparity)
        else:
            t1 = tf.tan(T_grids)
            t2 = tf.tan(T_grids - np.pi * disparity)
        return baseline_distance / (tf.abs(t2 - t1) + epsilon)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号