-
Notifications
You must be signed in to change notification settings - Fork 4
/
one_click_install.sh
53 lines (46 loc) · 1.86 KB
/
one_click_install.sh
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
#!/bin/bash
# Check if virtual environment folder exists
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
python3 -m venv venv
fi
# Activate the virtual environment
source venv/bin/activate
# Upgrade pip to the latest version
python3 -m pip install --upgrade pip --no-cache-dir
# Create checkpoints directory if it does not exist
if [ ! -d "checkpoints" ]; then
mkdir checkpoints
fi
# Function to download models
download_models() {
echo "Downloading Depth-Anything-V2-Small model..."
curl -L -o checkpoints/depth_anything_v2_vits.safetensors "https://huggingface.co/MackinationsAi/Depth-Anything-V2_Safetensors/resolve/main/depth_anything_v2_vits.safetensors?download=true"
echo "Downloading Depth-Anything-V2-Base model..."
curl -L -o checkpoints/depth_anything_v2_vitb.safetensors "https://huggingface.co/MackinationsAi/Depth-Anything-V2_Safetensors/resolve/main/depth_anything_v2_vitb.safetensors?download=true"
echo "Downloading Depth-Anything-V2-Large model..."
curl -L -o checkpoints/depth_anything_v2_vitl.safetensors "https://huggingface.co/MackinationsAi/Depth-Anything-V2_Safetensors/resolve/main/depth_anything_v2_vitl.safetensors?download=true"
}
# Detect the operating system
OS="$(uname -s)"
case "$OS" in
Linux*)
echo "Linux detected"
download_models
echo "Installing PyTorch with CUDA support..."
pip install torch==2.0.0+cu121 torchvision==0.18.0+cu121 torchaudio==2.0.6.post1 --index-url https://download.pytorch.org/whl/cu121 --no-cache-dir
;;
Darwin*)
echo "macOS detected"
download_models
echo "Installing PyTorch without CUDA support..."
pip install torch torchvision torchaudio --no-cache-dir
;;
*)
echo "Unsupported OS"
exit 1
;;
esac
# Install other dependencies from requirements.txt
echo "Installing other dependencies..."
pip install -r requirements.txt --no-cache-dir