Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 2 KB

README.md

File metadata and controls

35 lines (28 loc) · 2 KB

Using depth.py (OPTIONAL)

depth.py is for generating .depthviewer files so that it can be opened with the DepthViewer.

Dependencies for depth.py

Also check the MiDaS github page.

  1. Install Python3. The version I use is 3.9.6. By default the program calls python, assuming it is on PATH. This can be changed in the options menu.
  2. Install OpenCV and Numpy.
    pip install opencv-python numpy
  3. (Optional but recommended) Install CUDA. You may want to get the version 11.7; see below.
  4. Install Pytorch that matches your environment from here. For me (win64 cuda11.7) it is
    pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu117
  5. Install timm for MiDaS.
    pip install timm
  6. Go to the directory depthpy and run
    python depth.py --help
    and see if it prints the manual without any error.
  7. Get dpt_hybrid_384 model (and others) from here and locate them in depthpy/weights. Do not change the filenames. (Other models can be loaded by adding the -t argument, see --help for more.)
  8. Place any image in the depthpy directory, rename it to test.jpg (or test.png) and run
    python depth.py test.jpg out.depthviewer -i
    See if it generates an output. Also check if depth.py is using CUDA by checking device: cuda line.

If it isn't and you want to use CUDA:

  • Check the installed CUDA version and if the installed Pytorch version supports that.
  • Uninstall Pytorch pip uninstall torch torchvision and reinstall it.

For depthserver.py (Deprecated)

  • Install Flask pip install Flask
  • Run python depthserver.py to open the server and connect to it via the option menu. If it's connected all image inputs will be processed by calling the server.

Using depthmq.py

See ../../README.md