LASER / setup.sh
moqingyan123
fixed vine for hf spaces compatibility
c77348c
raw
history blame
1.61 kB
#!/bin/bash
set -e
echo "=========================================="
echo "VINE Demo Setup Script for HuggingFace Spaces"
echo "=========================================="
# Install system dependencies
echo "Installing system dependencies..."
apt-get update -qq
apt-get install -y -qq ffmpeg
# Install additional required packages
echo "Installing additional Python packages..."
pip install --no-cache-dir flax openai
pip install --no-cache-dir spacy spacy_fastlang
pip install --no-cache-dir decord
# Download spacy language model
echo "Downloading spacy language model..."
python -m spacy download en_core_web_lg
# Install local packages in editable mode from src/
echo "Installing local packages in editable mode..."
# Install video-sam2
if [ -d "src/video-sam2" ]; then
echo "Installing video-sam2..."
pip install --no-cache-dir -e src/video-sam2
fi
# Install LASER
if [ -d "src/LASER" ]; then
echo "Installing LASER..."
pip install --no-cache-dir -e src/LASER
fi
# Install vine_hf
if [ -d "src/vine_hf" ]; then
echo "Installing vine_hf..."
pip install --no-cache-dir -e src/vine_hf
fi
# Install GroundingDINO and build C++ extensions
if [ -d "src/GroundingDINO" ]; then
echo "Installing GroundingDINO..."
pip install --no-cache-dir -e src/GroundingDINO
echo "Building GroundingDINO C++ extensions (will show warnings if CUDA unavailable)..."
cd src/GroundingDINO
python setup.py build_ext --inplace 2>&1 | tail -20
cd ../..
fi
echo "=========================================="
echo "Setup complete!"
echo "=========================================="