{"id":20305085,"url":"https://github.com/luis-kr/depthmap","last_synced_at":"2026-02-08T16:32:00.083Z","repository":{"id":261415400,"uuid":"884241922","full_name":"Luis-Kr/DepthMap","owner":"Luis-Kr","description":"Depth map estimation tool using Depth-Anything-V2. Generate accurate depth maps from images with support for both relative and metric depth measurements.","archived":false,"fork":false,"pushed_at":"2024-11-14T08:19:30.000Z","size":23795,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-14T11:17:49.219Z","etag":null,"topics":["cuda","depth-anything","depth-estimation","depth-map","image-processing","python","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Luis-Kr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-06T12:03:39.000Z","updated_at":"2024-11-14T08:19:34.000Z","dependencies_parsed_at":"2024-11-06T13:29:17.678Z","dependency_job_id":null,"html_url":"https://github.com/Luis-Kr/DepthMap","commit_stats":null,"previous_names":["luis-kr/depthmap"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luis-Kr%2FDepthMap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luis-Kr%2FDepthMap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luis-Kr%2FDepthMap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luis-Kr%2FDepthMap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Luis-Kr","download_url":"https://codeload.github.com/Luis-Kr/DepthMap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241801936,"owners_count":20022553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cuda","depth-anything","depth-estimation","depth-map","image-processing","python","pytorch"],"created_at":"2024-11-14T17:06:59.571Z","updated_at":"2026-02-08T16:32:00.053Z","avatar_url":"https://github.com/Luis-Kr.png","language":"Python","readme":"![DepthMap](DepthMap.png)\n\nA Python workflow for depth map estimation using [Depth-Anything](https://github.com/DepthAnything/Depth-Anything-V2?tab=readme-ov-file). This tool processes images to generate depth maps using the Depth-Anything-V2 model, providing both visual depth maps and numerical depth data. It automatically handles model downloading, environment setup, and provides an easy-to-use interface for batch processing images.\n\n## Features\n- Automatic download of pre-trained Depth-Anything-V2 models (large version only)\n- Batch processing of images\n- Outputs both visual depth maps and raw depth data\n- Statistical analysis of depth values\n- CSV export of depth statistics\n\n## Installation\n\nMake sure you have Conda installed. If not, download it from [Miniconda](https://docs.anaconda.com/miniconda/)\n\nTo set up the project, follow these steps:\n\n```bash\n# Clone the repository\ngit clone https://github.com/Luis-Kr/DepthMap.git\n\n# Navigate into the directory\ncd DepthMap\n\n# Run setup script (this will download large models \u003e2GB)\npython setup.py\n```\n\n## Usage\n\nRun the depth estimation with default settings:\n\n```bash\n# Activate the conda environment\nconda activate depthmap\n\n# Run the main script to create the depth maps with the default configurations\npython -m DepthMap.main\n```\n\n### Mac-specific issues (Apple Silicon)\n\nI case the error message `Unexpected error: The operator 'aten::upsample_bicubic2d.out' is not currently implemented for the MPS device` appears when running the script. This occurs because PyTorch's Metal Performance Shaders (MPS) backend for Apple Silicon doesn't yet support all operations. To work around this:\n\n```bash\n# Set this environment variable before running\nexport PYTORCH_ENABLE_MPS_FALLBACK=1\n\n# Or: alternatively, you can add this line to your .zshrc or .bash_profile file to make it persistent across terminal sessions:\necho 'export PYTORCH_ENABLE_MPS_FALLBACK=1' \u003e\u003e ~/.zshrc #same applies for .bash_profile\nsource ~/.zshrc\n```\n\n**Note**: Using this fallback will cause these specific operations to run on CPU instead of GPU, which may result in slightly slower performance.\n\n\n\n### Configuration\n\nThe default configuration can be found in config/main.yaml. You can override any of these settings via command line:\n\n- `input_folder`: Directory containing input images\n- `output.dir`: Directory for saving depth maps\n- `depth_measurement`: Choose between \"relative\" or \"metric\" depth\n  - `relative`: Provides relative depth values (better for general use)\n  - `metric`: Fine-tuned version that attempts to predict actual depth in meters\n- `encoder`: Model encoder type (currently only \"vitl\" supported)\n- `dataset`: For metric depth, choose between:\n  - `hypersim`: Optimized for indoor scenes\n  - `vkitti`: Optimized for outdoor scenes\n- `max_depth`: Maximum depth (in meters) to be expected in the input image (only for metric depth)\n\n\nExample with multiple parameters:\n\n```bash\npython -m DepthMap.main \\\n    input_folder=my_images \\\n    output.dir=results \\\n    depth_measurement=metric \\\n    dataset=hypersim \\\n    max_depth=10\n```\n\n## Output\n\nThe tool generates:\n\n1. Colored depth maps in `\u003coutput.dir\u003e/images/`\n2. Raw depth arrays in `\u003coutput.dir\u003e/arrays/`\n3. CSV file with depth statistics including:\n    - 5th percentile depth\n    - 95th percentile depth\n    - Mean depth\n    - Median depth\n\n\n## Requirements\n- Python 3.8+\n- CUDA-capable GPU (recommended)\n- Conda package manager\n\n## License\n\nThis project has two licensing components:\n\n1. **Depth-Anything Model**: The Depth-Anything model is governed by its own license terms. You must comply with the [Depth-Anything License](https://github.com/DepthAnything/Depth-Anything-V2/blob/main/LICENSE) for any use of the model.\n\n2. **This Project**: The DepthMap workflow code (excluding the Depth-Anything model) is released under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluis-kr%2Fdepthmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluis-kr%2Fdepthmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluis-kr%2Fdepthmap/lists"}