mic-rud / GuidedDecoding

Accompaning repository for the 2022 ICRA paper "Lightweight Monocular Depth Estimation through Guided Decoding"
42 stars 9 forks source link

How to measure distance from depth map? #5

Closed puyiwen closed 1 year ago

puyiwen commented 2 years ago

The output of the network is a predicted depth value, so what post-processing is needed to obtain the true depth value?Thank you very much!!

mic-rud commented 1 year ago

For evaluation, inverse depth norm is required. You can find the procedure in inference.py

inv_prediction = self.model(image)
prediction = self.inverse_depth_norm(inv_prediction)

max_depths = {
    'kitti': 80.0,
    'nyu' : 10.0,
    'nyu_reduced' : 10.0,
}

def inverse_depth_norm(self, depth):
        depth = self.maxDepth / depth
        depth = torch.clamp(depth, self.maxDepth / 100, self.maxDepth)
        return depth ```