PlantPulse AI: Advanced Plant Disease Detection System Using Deep Learning - Final Year Project with Source Code
Back to Project| Component | Minimum Requirement | Recommended |
|---|---|---|
| Operating System | Windows 10, macOS 10.14, Ubuntu 18.04 | Windows 11, macOS 12+, Ubuntu 22.04 |
| Python Version | Python 3.8 | Python 3.10 or higher |
| RAM | 4GB | 8GB or more |
| Storage | 2GB free space | 5GB free space |
| Processor | Dual Core 2.0 GHz | Quad Core 2.5 GHz or higher |
python --versionpip --versionpython get-pip.pycd path/to/plantpulse-ai
Example for Windows:
cd C:\Users\YourName\Desktop\plantpulse-ai
Example for Mac/Linux:
cd ~/Desktop/plantpulse-ai
Why Virtual Environment? It keeps project dependencies isolated and prevents conflicts with other Python projects.
python -m venv venv
venv\Scripts\activate
(venv) prefix in your command promptpython3 -m venv venv
source venv/bin/activate
(venv) prefix in your terminal(venv) prefix)pip install --upgrade pip
pip install -r requirements.txt
| Package | Version | Purpose |
|---|---|---|
| Flask | 2.3.0 | Web framework for backend application |
| TensorFlow | 2.13.0 | Deep learning framework for AI model |
| Keras | 2.13.1 | High-level neural networks API |
| OpenCV | 4.8.0 | Image processing and computer vision |
| NumPy | 1.24.3 | Numerical computing library |
| Pillow | 10.0.0 | Image file handling |
| Werkzeug | 2.3.0 | WSGI utility library for Flask |
models folder inside project directoryplant_disease_model.h5 file existsapp.py file in any text editor (VS Code, Notepad++, etc.)
UPLOAD_FOLDER = 'uploads'
MAX_FILE_SIZE = 16 * 1024 * 1024 # 16MB
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg'}
uploads - For storing user uploaded imagesstatic/uploads - For serving processed imagesmkdir uploads mkdir static/uploads
python app.py
* Serving Flask app 'app'
* Debug mode: on
WARNING: This is a development server.
* Running on http://127.0.0.1:5000
Press CTRL+C to quit
http://localhost:5000 or http://127.0.0.1:5000
plantpulse-ai/
│
├── app.py # Main Flask application file
├── requirements.txt # Python dependencies list
├── README.md # Project documentation
│
├── models/
│ └── plant_disease_model.h5 # Trained deep learning model (85MB)
│
├── static/
│ ├── css/
│ │ └── style.css # Stylesheet files
│ ├── js/
│ │ └── script.js # JavaScript files
│ ├── images/ # Static images
│ └── uploads/ # Processed uploaded images
│
├── templates/
│ ├── index.html # Homepage
│ ├── detect.html # Detection page
│ ├── diseases.html # Disease catalog
│ ├── about.html # About page
│ └── contact.html # Contact page
│
├── uploads/ # User uploaded images (temporary)
│
├── utils/
│ ├── preprocessing.py # Image preprocessing functions
│ └── model_utils.py # Model loading and prediction
│
└── venv/ # Virtual environment (created by you)
Error: Could not install TensorFlow
Solution:
pip install tensorflow-cpu
Error: Address already in use
Solution:
app.run(debug=True, port=5001)
netstat -ano | findstr :5000lsof -i :5000Error: Cannot find model file or model loading error
Solution:
models/ directoryError: ImportError: DLL load failed (Windows) or similar
Solution:
pip uninstall opencv-python pip install opencv-python
pip install opencv-python-headless
sudo apt-get install python3-opencv sudo apt-get install libsm6 libxext6 libxrender-dev
Error: ModuleNotFoundError: No module named 'xyz'
Solution:
pip install -r requirements.txt
pip install module-name
Error: MemoryError or ResourceExhaustedError
Solution:
Edit the last line of app.py:
app.run(host='0.0.0.0', port=8080, debug=True)
host='0.0.0.0' - Makes app accessible from other devices on networkport=8080 - Changes port numberdebug=False - Disable debug mode for productionpip install gunicorn
gunicorn -w 4 -b 0.0.0.0:5000 app:app
-w 4 means 4 worker processes (adjust based on CPU cores)docker build -t plantpulse-ai .
docker run -p 5000:5000 plantpulse-ai
Create a .env file in project root for sensitive configurations:
FLASK_APP=app.py
FLASK_ENV=development
SECRET_KEY=your-secret-key-here
MAX_CONTENT_LENGTH=16777216
UPLOAD_FOLDER=uploads
MODEL_PATH=models/plant_disease_model.h5
Use tools like Postman or curl to test API:
curl -X POST -F "file=@path/to/image.jpg" http://localhost:5000/predict
CTRL + C in the terminal/command promptdeactivate
.env file to version controlCongratulations! You have successfully installed and configured PlantPulse AI. You are now ready to detect plant diseases using artificial intelligence.
Our team is here to assist you with installation and setup.