Skip to content
 
 

Repository files navigation

🎯 Depth Anything V2 - Image to Point Cloud

Generate metric point clouds from single images using Depth Anything V2.


🚀 Quick Setup (One Command)

git clone https://github.com/CoderSATTY/image-to-pcd.git
cd image-to-pcd
chmod +x setup.sh && ./setup.sh

This downloads the model weights (~1.3GB) and sets up all dependencies.


📦 Usage

python depth_to_pointcloud.py \
  --encoder vitl \
  --load-from checkpoints/depth_anything_v2_metric_hypersim_vitl.pth \
  --max-depth 20 \
  --img-path ./input \
  --outdir ./output

Arguments:

Argument Description Default
--encoder Model size: vits, vitb, vitl vitl
--load-from Path to model checkpoint Required
--max-depth Max depth in meters (20=indoor, 80=outdoor) 20
--img-path Input image(s) path Required
--outdir Output directory for .ply files Required
--calibration Camera calibration file (.npz) Optional

📁 Project Structure

image-to-pcd/
├── setup.sh                    # Run this first!
├── depth_to_pointcloud.py      # Main script
├── checkpoints/                # Model weights (auto-downloaded)
│   └── depth_anything_v2_metric_hypersim_vitl.pth
├── depth_anything_v2/          # Model code (auto-cloned)
├── input/                      # Place your images here
└── output/                     # Point clouds saved here

🔗 Model Download Links (Manual)

If you prefer manual download:

Model Size Download
Large (recommended) 335M depth_anything_v2_metric_hypersim_vitl.pth
Base 97.5M depth_anything_v2_metric_hypersim_vitb.pth
Small 24.8M depth_anything_v2_metric_hypersim_vits.pth

Place in checkpoints/ directory.


🙏 Acknowledgements

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages