MiDaS
GitHub Repository
During installation, I ran into an issue where the CUDA package wasn't found. Had to modify environment.yaml to:
1name: midas-py310
2channels:
3 - pytorch
4 - defaults
5dependencies:
6 - nvidia::cuda-toolkit=11.7.0
7 - python=3.10.8
8 - pytorch::pytorch=1.13.0
9 - torchvision=0.14.0
10 - pip=22.3.1
11 - numpy=1.23.4
12 - pip:
13 - opencv-python==4.6.0.66
14 - imutils==0.5.4
15 - timm==0.6.12
16 - einops==0.6.0
Commands that were helpful for troubleshooting CUDA:
1conda list env
2conda env remove -n midas-py310
3python -m torch.utils.collect_env
4nvidia-smi
5conda install cudatoolkit
1conda install -c "nvidia/label/cuda-11.7.0" cuda-toolkit
Activate the Conda environment
1conda activate midas-py310
Run MiDaS
From the Conda Shell, cd to the MiDaS directory1cd C:\Users\trima\MiDaS
Place the image frames you would like to process in the "input" directory and run one of the following commands:
1# dpt_beit_large_512
2python run.py --model_type dpt_beit_large_512 --input_path input --output_path output --grayscale --optimize
3# dpt_swin2_large_384
4python run.py --model_type dpt_swin2_large_384 --input_path input --output_path output --grayscale --optimize
5# dpt_swin2_tiny_256
6python run.py --model_type dpt_swin2_tiny_256 --input_path input --output_path output --grayscale --optimize
For "inferno" color mapping, omit the --grayscale flag.