nianticlabs / monodepth2

[ICCV 2019] Monocular depth estimation from a single image
Other
4.13k stars 953 forks source link

Loss calculation #457

Closed CC-Xiaoyu closed 1 year ago

CC-Xiaoyu commented 1 year ago

hello,Thank you for your contribution! I have a question. In the Monocular Depth Estimation,when the loss calculation. why The variable source_scale is always = 0?

`def compute_losses(self, inputs, outputs): """Compute the reprojection and smoothness losses for a minibatch """ losses = {} total_loss = 0

    for scale in self.opt.scales:
        loss = 0
        reprojection_losses = []

        if self.opt.v1_multiscale:
            source_scale = scale
        else:
            **source_scale = 0**

        disp = outputs[("disp", scale)]
        color = inputs[("color", 0, scale)]
        target = inputs[("color", 0, source_scale)]`
daniyar-niantic commented 1 year ago

Hi @CC-Xiaoyu The source scale here refers to the full resolution images. The warping is done at full resolution, rather than using downsampled images, see the paper for details.