SamsungLabs / saic_depth_completion

Official implementation of "Decoder Modulation for Indoor Depth Completion" https://arxiv.org/abs/2005.08607
Mozilla Public License 2.0
106 stars 17 forks source link

The LogDepthL1loss code #9

Open eecoder-dyf opened 1 year ago

eecoder-dyf commented 1 year ago

In saic_depth_completion\metrics\absolute.py, class LogDepthL1loss, Line 35,

diff = torch.abs(torch.log(gt[mask]) - pred[mask])

Is there something mistake? Why use |log(gt)-pred|? I think the code might be

diff = torch.abs(torch.log(gt[mask])-torch.log(pred[mask]))

Is this correct?

DiTo97 commented 1 year ago

Hi @eecoder-dyf,

The code is correct as-is, since the model is already tasked with predicting the logarithmic depth (see dm_lrn.py#L28).

Therefore, we only have to apply the logarithm to the ground truth depth to directly compute the L1 loss.