smallGroupProject / quickstart.sh
Mert Yerlikaya
Add feature-rich Gradio UI with mock model
505fc99
#!/bin/bash
# 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