Download scripts/setup.sh from Atomio/facerecog: direct link, hf CLI and curl.
- Browser
- Download file 1.86 kB
-
https://huggingface.co/spaces/Atomio/facerecog/resolve/main/scripts/setup.sh
- Command line
-
hf download hf://spaces/Atomio/facerecog/scripts/setup.sh
-
curl -L -o setup.sh https://huggingface.co/spaces/Atomio/facerecog/resolve/main/scripts/setup.sh
1.86 kB
| # Face Recognition API Setup Script | |
| set -e | |
| echo "π Setting up Face Recognition API..." | |
| # Check if Python 3.11+ is installed | |
| python_version=$(python3 --version 2>&1 | awk '{print $2}' | cut -d. -f1,2) | |
| required_version="3.11" | |
| if [ "$(printf '%s\n' "$required_version" "$python_version" | sort -V | head -n1)" != "$required_version" ]; then | |
| echo "β Python 3.11 or higher is required. Current version: $python_version" | |
| exit 1 | |
| fi | |
| echo "β Python version check passed: $python_version" | |
| # Create virtual environment | |
| if [ ! -d "venv" ]; then | |
| echo "π¦ Creating virtual environment..." | |
| python3 -m venv venv | |
| fi | |
| # Activate virtual environment | |
| echo "π§ Activating virtual environment..." | |
| source venv/bin/activate | |
| # Upgrade pip | |
| echo "β¬οΈ Upgrading pip..." | |
| pip install --upgrade pip | |
| # Install dependencies | |
| echo "π Installing dependencies..." | |
| pip install -e ".[dev,test]" | |
| # Copy environment file | |
| if [ ! -f ".env" ]; then | |
| echo "π Creating .env file from template..." | |
| cp .env.example .env | |
| echo "β οΈ Please edit .env file with your Supabase credentials" | |
| else | |
| echo "β .env file already exists" | |
| fi | |
| # Create necessary directories | |
| echo "π Creating directories..." | |
| mkdir -p uploads | |
| mkdir -p temp | |
| mkdir -p logs | |
| # Install pre-commit hooks | |
| echo "πͺ Installing pre-commit hooks..." | |
| pre-commit install | |
| # Run initial checks | |
| echo "π Running initial code checks..." | |
| ruff check . --exclude=venv,build,dist --fix || true | |
| ruff format . --exclude=venv,build,dist | |
| echo "β Setup complete!" | |
| echo "" | |
| echo "Next steps:" | |
| echo "1. Edit .env file with your Supabase credentials" | |
| echo "2. Run the SQL files in sql/ directory in your Supabase SQL Editor" | |
| echo "3. Activate virtual environment: source venv/bin/activate" | |
| echo "4. Start development server: make dev" | |
| echo "" | |
| echo "For more commands, run: make help" | |