File size: 1,642 Bytes
505fc99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/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