-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtest.ps1
More file actions
90 lines (79 loc) · 2.9 KB
/
Copy pathtest.ps1
File metadata and controls
90 lines (79 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Colors from CSS (exact match with templates/index.html)
# #39ff14 - accent-lime (RGB: 57, 255, 20)
# #00d9ff - info/cyan (RGB: 0, 217, 255)
function Write-Lime {
param([string]$Text)
Write-Host $Text -ForegroundColor ([System.ConsoleColor]::Green)
}
function Write-Cyan {
param([string]$Text)
Write-Host $Text -ForegroundColor ([System.ConsoleColor]::Cyan)
}
# Quick test script to verify setup
Write-Cyan "Testing Depth Surge 3D setup..."
# Check if virtual environment exists and activate it
if (Test-Path ".venv") {
Write-Lime "Activating virtual environment (.venv)..."
& .\.venv\Scripts\Activate.ps1
} elseif (Test-Path "venv") {
Write-Lime "Activating virtual environment (venv)..."
& .\venv\Scripts\Activate.ps1
} else {
Write-Host "Error: Virtual environment not found. Run .\setup.ps1 first." -ForegroundColor Red
exit 1
}
# Test basic imports
Write-Host ""
Write-Cyan "Testing Python imports..."
python -c @"
import torch
import cv2
import numpy as np
print('\033[38;2;57;255;20m✓\033[0m PyTorch version:', torch.__version__)
print('\033[38;2;57;255;20m✓\033[0m OpenCV version:', cv2.__version__)
print('\033[38;2;57;255;20m✓\033[0m NumPy version:', np.__version__)
print('\033[38;2;57;255;20m✓\033[0m CUDA available:', torch.cuda.is_available())
if torch.cuda.is_available():
print('\033[38;2;57;255;20m✓\033[0m CUDA device:', torch.cuda.get_device_name(0))
"@
# Test if video_depth_anything module loads
Write-Host ""
Write-Cyan "Testing Video-Depth-Anything module..."
python -c @"
import sys
from pathlib import Path
# Add the vendored Video-Depth-Anything repo to path
repo_path = Path('vendor/Video-Depth-Anything')
if repo_path.exists():
sys.path.insert(0, str(repo_path))
try:
from video_depth_anything import VideoDepthAnything
print('\033[38;2;57;255;20m✓\033[0m Video-Depth-Anything module imported successfully')
except Exception as e:
print(f'\033[38;2;255;0;0m✗\033[0m Error importing Video-Depth-Anything: {e}')
"@
# Test if model file exists
Write-Host ""
$modelPath = "models\Video-Depth-Anything-Large\video_depth_anything_vitl.pth"
if (Test-Path $modelPath) {
Write-Lime "✓ Video-Depth-Anything-Large model file found"
$modelSize = (Get-Item $modelPath).Length / 1MB
Write-Host " Model size: $([math]::Round($modelSize, 2)) MB"
} else {
Write-Host "✗ Model file not found at expected location" -ForegroundColor Yellow
Write-Host " Run .\scripts\download_models.ps1 large to download"
}
# Test ffmpeg
Write-Host ""
if (Get-Command ffmpeg -ErrorAction SilentlyContinue) {
Write-Lime "✓ FFmpeg is available"
ffmpeg -version 2>$null | Select-Object -First 1
} else {
Write-Host "✗ FFmpeg not found" -ForegroundColor Red
}
Write-Host ""
Write-Lime "Setup test complete!"
Write-Host ""
Write-Host "Next steps:"
Write-Host " Web UI: .\run_ui.ps1"
Write-Host " CLI: python depth_surge_3d.py input_video.mp4"