Create setup.sh
Browse files
setup.sh
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
echo "🚀 Setting up SAM2 + MatAnyone Video Background Replacer"
|
| 4 |
+
|
| 5 |
+
# Create directories
|
| 6 |
+
mkdir -p checkpoints
|
| 7 |
+
mkdir -p tmp
|
| 8 |
+
|
| 9 |
+
# Install Python dependencies
|
| 10 |
+
echo "📦 Installing Python dependencies..."
|
| 11 |
+
pip install -r requirements.txt
|
| 12 |
+
|
| 13 |
+
# Download SAM2 checkpoints
|
| 14 |
+
echo "⬇️ Downloading SAM2 checkpoints..."
|
| 15 |
+
cd checkpoints
|
| 16 |
+
|
| 17 |
+
# Download SAM2.1 large model (best performance)
|
| 18 |
+
wget -O sam2.1_hiera_large.pt https://dl.fbaipublicfiles.com/segment_anything_2/092824/sam2.1_hiera_large.pt
|
| 19 |
+
|
| 20 |
+
# Also download config files if needed
|
| 21 |
+
mkdir -p ../configs/sam2.1
|
| 22 |
+
cd ../configs/sam2.1
|
| 23 |
+
|
| 24 |
+
# Download config file
|
| 25 |
+
wget -O sam2.1_hiera_l.yaml https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/configs/sam2.1/sam2.1_hiera_l.yaml
|
| 26 |
+
|
| 27 |
+
cd ../..
|
| 28 |
+
|
| 29 |
+
echo "✅ Setup complete!"
|
| 30 |
+
echo "📋 To run the app:"
|
| 31 |
+
echo "streamlit run app.py --server.port=7860 --server.address=0.0.0.0 --server.maxUploadSize=200 --server.enableCORS=false --server.enableXsrfProtection=false"
|