Home ONNX Unidepth Monocular Metric Depth Estimation
Post
Cancel

Open In Github

!ONNX-UniDepth Monocular Metric Depth Estimation

Requirements

  • Check the requirements.txt file.
  • For ONNX, if you have a NVIDIA GPU, then install the onnxruntime-gpu, otherwise use the onnxruntime library.

Installation

1
2
3
git clone https://github.com/ibaiGorordo/ONNX-Unidepth-Monocular-Metric-Depth-Estimation.git
cd ONNX-Unidepth-Monocular-Metric-Depth-Estimation
pip install -r requirements.txt

ONNX Runtime

For Nvidia GPU computers: pip install onnxruntime-gpu

Otherwise: pip install onnxruntime

ONNX model

  • Download the model from Hugging Face and save it in the models folder.
  • Otherwise use this Google Colab notebook to convert the model: Open In Colab

Original UniDepth model

The original UniDepth model can be found in this repository: UniDepth Repository

  • The License of the models is Attribution-NonCommercial 4.0 International: License

Examples

  • Image inference:
    1
    
     python image_depth_estimation.py
    
  • Webcam inference:
    1
    
     python webcam_depth_estimation.py
    
  • Video inference:
    1
    
     python video_depth_estimation.py
    
  • Rerun SDK visualization: https://youtu.be/NBkWIlEIEi0?si=YhBbaVaAlSyVIpit
    1
    
     python video_depth_estimation.py
    

!Unidepth Rerun SDK visualization

Original video: https://www.youtube.com/watch?v=8jsXi_51B40

References:

This post is licensed under CC BY 4.0 by the author.