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
4k stars 345 forks source link

Why choice of max-depth does not work? #107

Open Blissy-32 opened 4 months ago

Blissy-32 commented 4 months ago

when running the metric/run.py, whatever the value of max-depth is,the predicted value always vary from 0 to 255:python metric_depth/run.py --img-path /home/xxf/ORB_SLAM2_modified/Examples/datasets/test1/rgb --outdir outputs/huanghua/ --grayscale --pred-only --max-depth 80

Blissy-32 commented 4 months ago

have done, any who what to get the metric depth map can do the follows: # depth = (depth - depth.min()) / (depth.max() - depth.min()) * 255.0

depth = depth.astype(np.uint8)

    depth *= 1000
    depthg = depth.astype(np.uint16)

    # if args.grayscale:
    #     depth = np.repeat(depth[..., np.newaxis], 3, axis=-1)
    # else:
    #     depth = (cmap(depth)[:, :, :3] * 255)[:, :, ::-1].astype(np.uint8)