-
Notifications
You must be signed in to change notification settings - Fork 761
Description
Here is a tutorial idea for Depth Anything i've made incase you want to use it:
This exists to assist people attempting to download depth who need help with installation.
**Depth Anything V2 + Blender Integration (No Virtual Env)
🧩 Step 1: Extract the ZIP File**
Locate your downloaded file:
Depth-Anything-V2-main.zip
Right-click → Extract All…
Place it somewhere convenient, for example:
C:\Users<you>\Documents\Depth-Anything-V2-main
(Replace with your Windows username.)
### 🧰 Step 2: Install Python
If you don’t already have Python:
Go to https://www.python.org/downloads/
Download and install Python 3.10 – 3.12
During installation, check ✅ “Add Python to PATH”
Verify the installation:
python --version
### 📦 Step 3: Install Dependencies (inside the project folder)
Open a terminal or PowerShell inside the extracted folder:
Windows:
Navigate to the folder
Hold Shift + Right-click → choose “Open PowerShell window here”
You’ll see a prompt like:
PS C:\Users<you>\Documents\Depth-Anything-V2-main>
Then install dependencies:
🔹 If you have an NVIDIA GPU:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
🔹 If you’re using CPU only:
pip install torch torchvision torchaudio
Then install the rest:
pip install gradio opencv-python pillow numpy timm einops tqdm
### 🧠 Step 4: Verify Installation (Optional but Recommended)
Run these quick checks:
python -c "import torch; print('✅ torch OK, CUDA:', torch.cuda.is_available())"
python -c "import gradio; print('✅ gradio OK')"
python -c "import cv2, PIL, numpy, timm, einops, tqdm; print('✅ all others OK')"
✅ You should see:
✅ torch OK, CUDA: True (or False if CPU)
✅ gradio OK
✅ all others OK
### 🚀 Step 5: Run the App
Now, still in that folder, launch:
python app.py
Wait a few seconds — then you’ll see:
Running on local URL: http://127.0.0.1:7860
✅ Your default browser (like Chrome) will automatically open a new tab to that address — just like Sammie Roto.
### 🌐 Step 6: Use the Gradio Web Interface
In the browser tab:
Click Upload Image
Choose any image (photo, render, etc.)
Click Run or Generate Depth
Wait for it to process (watch the progress bar)
You’ll see:
Left: Original Image
Right: AI-generated Depth Map
### 💾 Step 7: Save Your Depth Map
There are two options:
Option 1 — From the Browser:
Right-click the depth map → “Save image as…”
Option 2 — From the Project Folder:
Check inside:
C:\Users<you>\Documents\Depth-Anything-V2-main\outputs\
or sometimes:
results\ or gradio\outputs\
Save that grayscale image somewhere easy to find.
### 🧠 Step 8: Verify Your Depth Map
Open it with the Photos app:
You should see a grayscale image.
White = closer, Black = farther away
✅ That confirms Depth Anything is working perfectly.