Single image to Point Cloud Data converter using Depth Anything V2. This project provides a simple pipeline to generate 3D point clouds from 2D images by estimating depth information.
- Single image depth estimation using Depth-Anything-V2
- 3D point cloud generation with RGB color information
- Optional mask support for filtered point cloud generation
- Outputs both PCD file and depth image
torch
opencv-python
numpy
open3d
depth-anything-v2
mkdir images result checkpoint
- Clone the repository:
git clone https://github.com/Oh-JongJin/Image2PCD.git
cd Image2PCD
- Install dependencies:
pip install torch opencv-python numpy open3d
# Install Depth Anything V2
git clone https://github.com/DepthAnything/Depth-Anything-V2.git
- Download the pre-trained weights for Depth Anything V2 (vitl model):
mkdir checkpoint
# Download depth_anything_v2_vitl.pth and place it in the checkpoint directory
├── Depth-Anything-V2/ # Refer to the Installation section
├── images/ # Input images directory
├── result/ # Output directory for PCD and depth visualization
├── checkpoint/ # Directory for model weights
├── run.py # Main script
├── LICENSE
└── README.md
-
Place your input images in the
images/
directory -
Run the script:
python run.py
- Check the results in the
result/
directory:
IMAGE_NAME.pcd
: Point cloud data fileIMAGE_NAME.jpg
: Depth visualization image
-
Point Cloud: Standard PCD format with RGB colors (pptk view)
-
Depth Map: Grayscale image (8-bit) with normalized depth values
- Depth Anything V2 for the depth estimation model
- Open3D for point cloud processing capabilities