jahaniam/semiDepth

Why inverse depth regression? Why not disparity regression?

mitra052 opened this issue · 2 comments

Hi Ali,

I have some queries regarding the semiDepth code:

  1. I see that you have made the semiDepth model output pho(1/real depth) values as opposed to scaled disparity as outputted by monodepth. As such you have used 1/depth values for adding the lidar loss. I was wondering that you could also have used disparity loss (as opposed to inverse depth loss) by converting the input lidar depths to disparity. Did you face any issues in that?

  2. I am assuming that you replaced the zero depth values with -1 in order to prevent the gradient to flow through them. How do you think the disparity values should be replaced with in case of the zero depth values? Any suggestions would be appreciated!

  3. https://github.com/jahaniam/semiDepth/blob/master/monodepth_model.py#L183
    In this piece of code I see that you have dropped the 0.3 which was multiplied in monodepth, link below
    https://github.com/mrharicot/monodepth/blob/master/monodepth_model.py#L123

I am guessing this is also because you want to calculate the inverse depth as opposed to scaled disparity in monodepth. They probably used it to restrict the disparity to only 30% of the whole image width?

It would be great if you can answer these queries!

Hi.

  1. Yes, that is doable. I didn't face any issues in that.

  2. It doesn't matter. You can put a negative number. The important part is to calculate a mask and somehow filter those negative numbers and don't calculate the loss for them.You can either do it by using boolean_mask or multiplying a binary mask image as I did. The tf boolean_mask is probably a better solution.

  3. You are right. They used 0.3 to limit the disparity between 0-0.3. and we want to predict depth>1 which means 0<inv_depth<1

Thanks for addressing my queries!