DepthAnything / Depth-Anything-V2

[NeurIPS 2024] Depth Anything V2. A More Capable Foundation Model for Monocular Depth Estimation
https://depth-anything-v2.github.io
Apache License 2.0
3.78k stars 319 forks source link

How to deal with the too large value while transforming relative depth into absolute depth? #98

Open suzdl opened 3 months ago

suzdl commented 3 months ago

I adopt the following formula to get absolute depth in way of reciprocal: abs_depth = 1/inv_depth However, the depth_anything_v2 model will estimate some too-small values, and make the reciprocal too large. These values that are too large will seriously affect the scale and shift compared to GT and also affect the evaluation of relative depth. I did not find related code in this project, can you provide the factually used code for transforming and evaluating relative depth?

suzdl commented 3 months ago

another question: Are the (depth-depth_min)/(depth_max-depth_min) used in evaluation of relative depth?

Shiyao-Xu commented 3 months ago

I guess you could try to filter out those too small relative depth value first.

suzdl commented 3 months ago

I tried to filter out small values, but different filtering methods will affect the result while doing least square transforming to absolute depth. The metrics of transformed relative depth can not hold good metrics compared to depth GT, for example, the metrics of RMSE.

Edric-star commented 3 months ago

Hi, can I ask you a question? If you obtained the scale and shift from applying the least square equation to a single image, are the scale and shift of this image able to be applied to other images that are shot from the same camera? Or the certain image only? @suzdl

suzdl commented 3 months ago

Hi, can I ask you a question? If you obtained the scale and shift from applying the least square equation to a single image, are the scale and shift of this image able to be applied to other images that are shot from the same camera? Or the certain image only? @suzdl

The scale and shift are computed between depth GT and output relative depth. So it is the certain image only.

Edric-star commented 3 months ago

The scale and shift are computed between depth GT and output relative depth. So it is the certain image only.

Thanks