Jaykumaran R cd458a5eb8 depthpro-scripts_colpali_update 1 kuukausi sitten
..
Applications-with-Depth cd458a5eb8 depthpro-scripts_colpali_update 1 kuukausi sitten
readme_images cd458a5eb8 depthpro-scripts_colpali_update 1 kuukausi sitten
README.md cd458a5eb8 depthpro-scripts_colpali_update 1 kuukausi sitten
depthpro-app.py cd458a5eb8 depthpro-scripts_colpali_update 1 kuukausi sitten

README.md

Depth Pro: Sharp Monocular Metric Depth - Paper Explanation and Applications

This folder contains the Jupyter Notebooks and Scripts for the LearnOpenCV article - Apple Depth Pro: Sharp Monocular Metric Depth.

To run:

!git clone https://github.com/apple/ml-depth-pro.git
cd ml-depth-pro
#setup
!pip install -e .

You will need to download the pre-trained checkpoint using the following bash command which will place the model under ml-depth-pro/checkpoints/depth-pro.pt folder.

Download checkpoints: source get_pretrained_models.sh

Image Inference – Usage

!depth-pro-run -i image.jpg -o output_dir

The input can be an image or a directory containing multiple images, the output_dir will store the resulting inverse depth maps.

We have modified the ml-depth-pro/src/depth_pro/cli/run.py to save raw depth and surface normal and is named as depthpro-app.py


To run, python depthpro-app.py

To visualize metric depth per each pixel with a interactive OpenCV window, run

python metric-depth-visualize.py


Scripts: Applications of Depth Data In Image Editing

  • Parallax Effect with Adobe Software - parallax-effect.py
  • Depth of Field Effect - depth_of_field.py
  • Depth Blur / Portrait - depth_blur.py
  • 3D Point Cloud Projection - depthToPointCloud.ipynb

You can directly download the code files from the below link.

Download Code

AI Courses by OpenCV

Want to become an expert in AI? AI Courses by OpenCV is a great place to start.

img