cleinc / bts

From Big to Small: Multi-Scale Local Planar Guidance for Monocular Depth Estimation
GNU General Public License v3.0
635 stars 179 forks source link

Scale depth for a single photo prediction #94

Open Ale0311 opened 3 years ago

Ale0311 commented 3 years ago

Hello! Could you please tell me how to scale the depth estimation if my focal length is 1101.8513?

I use the nyu pretrained model and this scaling equation:

pred_depth_scaled = pred_depth * 518.8579/ 1101.8513 * 1000

518.8579 is the focal length of the nyu dataset. However, the results are not accurate. Am I not scaling the depth in a right way?

cogaplex-bts commented 3 years ago

@Ale0311 It is important to scale the resolution of input images to make the focal length is close to the focal length of the training images if you want use a pretrained model. For this, you can use OpenCV's remap function to simulate your images.

suyuzhang commented 3 years ago

@Ale0311 Did you solve this problem?

yyytpb commented 1 year ago

May I ask what the value 518 should be replaced with if I want to use my own dataset