Spaces:
Sleeping
Sleeping
| # Quickstart script for Plant Disease Detection UI | |
| # This script sets up the environment and runs the app | |
| echo "π± Plant Disease Detection - Quick Start" | |
| echo "========================================" | |
| echo "" | |
| # Check if Python is installed | |
| if ! command -v python3 &> /dev/null; then | |
| echo "β Error: Python 3 is not installed" | |
| echo "Please install Python 3.8 or higher" | |
| exit 1 | |
| fi | |
| echo "β Python found: $(python3 --version)" | |
| echo "" | |
| # Check if virtual environment exists | |
| if [ ! -d "venv" ]; then | |
| echo "π¦ Creating virtual environment..." | |
| python3 -m venv venv | |
| echo "β Virtual environment created" | |
| else | |
| echo "β Virtual environment already exists" | |
| fi | |
| echo "" | |
| # Activate virtual environment | |
| echo "π§ Activating virtual environment..." | |
| source venv/bin/activate | |
| # Install/upgrade dependencies | |
| echo "π₯ Installing dependencies..." | |
| pip install --upgrade pip > /dev/null 2>&1 | |
| pip install -r requirements.txt | |
| echo "β Dependencies installed" | |
| echo "" | |
| # Check if example images exist | |
| if [ ! -d "ui/examples" ] || [ -z "$(ls -A ui/examples 2>/dev/null)" ]; then | |
| echo "πΈ No example images found" | |
| echo "" | |
| read -p "Would you like to download example images? (y/n): " -n 1 -r | |
| echo "" | |
| if [[ $REPLY =~ ^[Yy]$ ]]; then | |
| echo "Downloading example images..." | |
| python3 download_examples.py | |
| echo "" | |
| fi | |
| fi | |
| # Run the app | |
| echo "π Starting the application..." | |
| echo "" | |
| echo "The app will be available at: http://localhost:7860" | |
| echo "Press Ctrl+C to stop the server" | |
| echo "" | |
| echo "========================================" | |
| echo "" | |
| cd ui | |
| python3 app.py | |