A step-by-step pipeline that takes a single image and produces depth maps, point clouds, and 3D meshes using the DepthAnything model.
- Estimates depth from any RGB image using DepthAnything (Hugging Face)
- Generates colorized depth maps
- Builds point clouds via pinhole and orthographic projection
- Reconstructs a 3D mesh using Poisson surface reconstruction
index.py— batch pipeline, processes multiple images fromdataset/index_v2.py— Streamlit web interface, upload one image and view each stage interactively
- Python 3.12
- CUDA-compatible GPU (tested on RTX 3060, CUDA 13.1)
python -m venv depthanything_env
depthanything_env\Scripts\activate
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu124
pip install transformers open3d opencv-python matplotlib numpy streamlit plotlyBatch mode
python index.pyRandomly samples images from dataset/ and saves results to results/.
Interactive UI
streamlit run index_v2.pyOpens in browser — upload an image and walk through all 6 stages.
Results are saved to results/:
N.png— original imageN_depth.png— grayscale depth mapN_depth_color.png— colorized depth mapmesh_ortho.obj— 3D mesh (compatible with Blender, Unity, Maya)