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.86k stars 336 forks source link

[Fix] image size before feeding into model #133

Open zafirshi opened 3 months ago

zafirshi commented 3 months ago

Hi 👋 !

Thx for your great work in monocular depth estimation and the results in my side is quite amazing! 🎉

In this PR:

  1. I fixed the issue with the input model image size. Previously, the height of the raw image was used for resizing (See), and if the resolution of the raw image is large, the program would run out of memory (OOM).

  2. Also I removed some redundant code from the script. For depth_pred, the original script performed a resize to match the resolution of depth_pred with that of the raw image (See). This operation has already been implemented in here and here.

    I would greatly appreciate it if PR could be accepted! Any code suggestions would be appreciated! 😄