MiDaS icon indicating copy to clipboard operation
MiDaS copied to clipboard

about median value calculation in loss function

Open mzy97 opened this issue 3 years ago • 2 comments

Please see here for code: https://gist.github.com/ranftlr/1d6194db2e1dffa0a50c9b0a9549cbd2

We've never tried this loss without the ReLU at the end, it is possible that this influences the training dynamic.

Hi, in paper, you said the median value comes from all valid pixels, but in the loss function below, medians were driven from all pixels. In case of the GT depth map is relatively sparse, will this code cause some issue? (eg. use mix dataset, where the valid pixel density of sample may change) https://gist.github.com/ranftlr/1d6194db2e1dffa0a50c9b0a9549cbd2#file-loss-py-L32

Originally posted by @mzy97 in https://github.com/intel-isl/MiDaS/issues/33#issuecomment-796752326

mzy97 avatar Mar 11 '21 13:03 mzy97

I opened an issue about this 3 months ago and have not received a response... https://github.com/intel-isl/MiDaS/issues/73

dfrumkin avatar Mar 11 '21 14:03 dfrumkin

I think it's right to use valid pixels to calculate median and I think the valid pixels should also be sorted when calculating trimmed later. Is that right?

yifeizhangfr avatar Jul 21 '21 04:07 yifeizhangfr