ClementPinard / SfmLearner-Pytorch

Pytorch version of SfmLearner from Tinghui Zhou et al.
MIT License
1.01k stars 224 forks source link

Weird results from pretrained model on KITTI images #136

Closed a961009 closed 1 year ago

a961009 commented 2 years ago

Thanks for the PyTorch codes! When I use the pretrained model (https://drive.google.com/drive/folders/1H1AFqSS8wr_YzwG2xWwAQHTfXN5Moxmx) to inference disp and depth on Kitti images, the disp and the depth result looks weird. The disp and the depth change very sharply. The main part of the disp is either 255 or 0, with almost no intermediate value. 2011_09_26_drive_0011_sync_03-0000000000_disp 0000000000 2011_09_26_drive_0011_sync_03-0000000000_depth

a961009 commented 2 years ago

Here are more results at different scenes 2011_09_26_drive_0001_sync_02-0000000039_displayImage 2011_09_26_drive_0009_sync_02-0000000375_displayImage 2011_09_26_drive_0015_sync_02-0000000266_displayImage

a961009 commented 2 years ago

https://github.com/ClementPinard/SfmLearner-Pytorch/blob/c2374d50f816e976c6889eb5e07198749d953bc6/run_inference.py#L66 should be tensor_img = ((tensor_img/255 - 0.5)/0.5).to(device)

ClementPinard commented 2 years ago

Hi, see #125 as to why we don't divide by 255.

You results are indeed a bit weird. I'll try to reproduce the results to see if something is wrong, will keep you updated.

a961009 commented 2 years ago

Thanks for your quick reply. After dividing by 255, the results become reasonable as mentioned in original paper. I'll keep you updated, when i find something.