Fix the official environment errors/incompatible
# Step 1: Install Anaconda
bash Anaconda3-2024.10-1-Linux-x86_64.sh
# Step 2: Create conda environment from YAML
conda env create -f dinov2-extras.yaml
# Step 3: Activate the environment
conda activate dinov2-extras
# Step 4: Install necessary packages
pip install -U openmim
mim install mmcv-full
pip install mmsegmentation==0.30.0 xformers==0.0.18If you get a warning saying that PyTorch CUDA version is not matching, do the following:
# Uninstall current PyTorch packages
pip uninstall torch torchvision torchaudio -y
# Reinstall with the correct CUDA version (11.8)
pip install torch==2.0.0+cu118 torchvision==0.15.0+cu118 torchaudio==2.0.0 --index-url https://download.pytorch.org/whl/cu118- Download DINOv2 from GitHub and unzip it.
- Navigate to the folder:
./dinov2(⚠️ Not./dinov2/dinov2) - Follow the steps in Installing Step One by One above.
- Activate the conda environment:
conda activate dinov2-extras
- Run the script:
python run.py --input <picture folder path> --output <output path>
- Set the desired backbone and head in the script or via command line.
- The
run.pyscript will automatically:- Load all
.pngimages in<picture folder path> - Process them into depth maps
- Save the results in
<output path>with the same format and filename
- Load all
Happy predicting! 😄