-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_env.sh
More file actions
44 lines (34 loc) · 1.01 KB
/
setup_env.sh
File metadata and controls
44 lines (34 loc) · 1.01 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
#!/usr/bin/env bash
set -e # Exit immediately if a command fails
ENV_NAME="segmentation_app"
PYTHON_VERSION="3.11"
echo "🚀 Creating conda environment: $ENV_NAME"
conda create -n "$ENV_NAME" python="$PYTHON_VERSION" -y
echo "🔄 Activating environment"
source "$(conda info --base)/etc/profile.d/conda.sh"
conda activate "$ENV_NAME"
echo "🎥 Installing ffmpeg"
conda install -c conda-forge ffmpeg -y
echo "🔥 Installing PyTorch with CUDA 12.4"
conda install pytorch torchvision torchaudio pytorch-cuda=12.4 \
-c pytorch -c nvidia -y
echo "📦 Installing Python packages via pip"
pip install --upgrade pip
pip install \
imageio \
gradio \
opencv-python \
python-dotenv \
omegaconf \
imageio-ffmpeg
echo "📥 Cloning SAM2 repository"
if [ ! -d "sam2" ]; then
git clone https://github.com/facebookresearch/sam2.git
fi
echo "🔧 Installing SAM2 (editable mode)"
cd sam2
pip install -e .
echo "⬇️ Downloading checkpoints"
cd checkpoints
bash download_ckpts.sh
echo "✅ Environment setup complete!"