Skip to content

Python scripts to perform monocular depth estimation using Python with the Midas v2.1 small Tensorflow Lite model.

License

Notifications You must be signed in to change notification settings

ibaiGorordo/Midasv2_1_small-TFLite-Inference

Repository files navigation

Midas v2.1 small TFLite Inference

Python scripts to perform monocular depth estimation using Python with the Midas v2.1 small Tensorflow Lite model. Tested on Windows 10, Tensorflow 2.4.0 (Python 3.8).

!Midas v2.1 small TFLite Inference

Requirements

  • OpenCV, Numpy and tflite (or tensorflow). pafy and youtube-dl are required for youtube video inference.

Installation

pip install numpy opencv-python tflite tensorflow
pip install pafy youtube-dl

Midas v2.1 small (link)

  • Input: RGB image of size 256 x 256 pixels.
  • Output: Inverse relative depth map with 256 x256 pixels.
  • Inference speed: - 30 FPS on Iphone 11 NPU and 22 FPS on OnePlus8 GPU (Snapdragon 865).

Examples

  • Image inference:
python imageDepthEstimation.py 
  • Webcam inference:
python webcamDepthEstimation.py
  • Video inference:
python videoDepthEstimation.py

!Midas v2.1 small TFLite Inference on video

Original video: https://youtu.be/TGadVbd-C-E (by Nagasaki Biopark)

About

Python scripts to perform monocular depth estimation using Python with the Midas v2.1 small Tensorflow Lite model.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages