A low-cost, CPU-based tool for independent developers to convert 2D RGB images into 3D point clouds/meshes using MiDaS depth estimation.
- Monocular Depth Estimation: Uses MiDaS (Small/Hybrid/Large) models.
- Point Cloud Generation: Converts depth maps to colored PLY point clouds.
- CPU Optimized: Designed to run on standard hardware without GPU requirements.
- CLI Interface: Simple command-line tool for conversion.
- Clone the repository.
- Install dependencies:
pip install -r requirements.txt
Convert a single image to a point cloud:
python cli.py -i input.jpg -o output.ply -m MiDaS_smallOptions:
-i, --input: Path to input image (required).-o, --output: Path to output file (default: output.ply).-m, --model: Model type (default: MiDaS_small). Options:MiDaS_small,DPT_Large,DPT_Hybrid.
from src.depth_estimation import DepthEstimator
from src.point_cloud_generation import PointCloudGenerator
# Estimate depth
estimator = DepthEstimator(model_type="MiDaS_small")
depth_map = estimator.estimate_depth("input.jpg")
# Generate point cloud
generator = PointCloudGenerator()
generator.depth_to_pointcloud(depth_map, "input.jpg", "output.ply")To deploy using Docker:
- Build and run the container:
docker-compose up -d --build
- Access the Web Interface at http://localhost:5000
For detailed instructions, see DEPLOYMENT.md.
Run unit tests:
pytest tests/MIT License