utiasSTARS / learned_scale_recovery

Accompanying code for 'Self-Supervised Scale Recovery for Monocular Visual Odometry'
47 stars 12 forks source link

Why "camera_height" must divide by 30 !? #2

Closed joeking11829 closed 2 years ago

joeking11829 commented 2 years ago

Hi. Thanks for sharing your great work.

when calculate scale_recovery loss, the "camera_height" must divide by 30. Why !?

Thanks !!

joeking11829 commented 2 years ago

Hi @brandonwagstaff,

Could you explain this issue ? Thanks !!

brandonwagstaff commented 2 years ago

Hi There,

Our depth predictions are defined to have a minimum and maximum of 0.06 and ~2.67, respectively. Since the real minimum and maximum scene depth values for KITTI are significantly larger than this, we applied an arbitrary scaling factor of 30 to roughly align the scales before applying our scale recovery loss (this allows us to produce scaled predictions without having to drastically shift the scale of the network predictions during training, which could be problematic).

To account for this scaling factor in our scale recovery loss, we also divide the camera height by 30 to match the scale of the raw predictions. Then, at test time, to produce the metrically scaled predictions, this same scaling factor can be applied (to both the depth and translation predictions).

Hope this helps!

joeking11829 commented 2 years ago

Hi There,

Our depth predictions are defined to have a minimum and maximum of 0.06 and ~2.67, respectively. Since the real minimum and maximum scene depth values for KITTI are significantly larger than this, we applied an arbitrary scaling factor of 30 to roughly align the scales before applying our scale recovery loss (this allows us to produce scaled predictions without having to drastically shift the scale of the network predictions during training, which could be problematic).

To account for this scaling factor in our scale recovery loss, we also divide the camera height by 30 to match the scale of the raw predictions. Then, at test time, to produce the metrically scaled predictions, this same scaling factor can be applied (to both the depth and translation predictions).

Hope this helps!

It does helps !! Thanks for your reply !!