File size: 969 Bytes
a1c205b |
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 |
#!/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" |