YvanYin / Metric3D

The repo for "Metric3D: Towards Zero-shot Metric 3D Prediction from A Single Image" and "Metric3Dv2: A Versatile Monocular Geometric Foundation Model..."
https://jugghm.github.io/Metric3Dv2/
BSD 2-Clause "Simplified" License
1.07k stars 75 forks source link

metric_scale in nyu.py #82

Closed choillee82 closed 2 months ago

choillee82 commented 2 months ago

First of all, thank you for sharing great work!

I have a question regarding metric_scale in nyu.py. As far as i know, usually use scale factor 1000.0 to make depth in meter with nyuv2 depth data. But, in your case, 6000.0 is used for scaling. If you don't mind could you let me know what the purpose of metric_scale is? I understand it is used for scaling to make depth in meter.

In nyu.py `NYU_dataset=dict( lib = 'NYUDataset', data_root = 'data/public_datasets', data_name = 'NYU', transfer_to_canonical = True, metric_scale = 6000.0, original_focal_length = 518.857, original_size = (480, 640), data_type='lidar', data = dict(

configs for the training pipeline

train=dict(
    anno_path='NYU/annotations/train.json',`
JUGGHM commented 2 months ago

First of all, thank you for sharing great work!

I have a question regarding metric_scale in nyu.py. As far as i know, usually use scale factor 1000.0 to make depth in meter with nyuv2 depth data. But, in your case, 6000.0 is used for scaling. If you don't mind could you let me know what the purpose of metric_scale is? I understand it is used for scaling to make depth in meter.

In nyu.py NYU_dataset=dict( lib = 'NYUDataset', data_root = 'data/public_datasets', data_name = 'NYU', transfer_to_canonical = True, metric_scale = 6000.0, original_focal_length = 518.857, original_size = (480, 640), data_type='lidar', data = dict( # configs for the training pipeline train=dict( anno_path='NYU/annotations/train.json',

Thanks for your interest! I have received e-mails with similar concerns. The metric scale is what you have said, to align with depth in meters. For the NYU dataset in our private environment, we extract the data from .mat files and save them with a factor of 6000. We selected 6000 as the metric scale because the range of NYU dataset is below 10m, and the upper bound of a 16-bit map is 65536. For your usage, metric scale should be changed in consistency with your dataset.