install sam2 the way facebook says

This commit is contained in:
2025-07-26 08:24:19 -07:00
parent 032ea9da4b
commit 98128b8099

View File

@@ -36,13 +36,11 @@ if [ ! -d "segment-anything-2" ]; then
fi
# Download SAM2 checkpoints using their official script
cd segment-anything-2
mkdir -p checkpoints
cd checkpoints
cd segment-anything-2/checkpoints
if [ ! -f "sam2.1_hiera_large.pt" ]; then
echo "📥 Downloading SAM2 checkpoints..."
chmod +x ../download_ckpts.sh 2>/dev/null || true
bash ../download_ckpts.sh || bash <(curl -s https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/download_ckpts.sh)
chmod +x download_ckpts.sh
bash download_ckpts.sh
fi
cd ../..