#!/bin/bash echo "🚀 Setting up SAM2 + MatAnyone Video Background Replacer" # Create directories mkdir -p checkpoints mkdir -p tmp # Install Python dependencies echo "📦 Installing Python dependencies..." pip install -r requirements.txt # Download SAM2 checkpoints echo "⬇️ Downloading SAM2 checkpoints..." cd checkpoints # Download SAM2.1 large model (best performance) wget -O sam2.1_hiera_large.pt https://dl.fbaipublicfiles.com/segment_anything_2/092824/sam2.1_hiera_large.pt # Also download config files if needed mkdir -p ../configs/sam2.1 cd ../configs/sam2.1 # Download config file wget -O sam2.1_hiera_l.yaml https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/configs/sam2.1/sam2.1_hiera_l.yaml cd ../.. echo "✅ Setup complete!" echo "📋 To run the app:" echo "streamlit run app.py --server.port=7860 --server.address=0.0.0.0 --server.maxUploadSize=200 --server.enableCORS=false --server.enableXsrfProtection=false"