LeafLens: AI Plant Disease Detection from Leaf Photos | Python Final Year Project with Source Code
Back to ProjectThis should take about 15 minutes. Most of that is waiting for TensorFlow to download. You don't need a GPU, you don't need to train anything, and you don't need a database server.
pip --version.cd LeafLens_Project_Architecture/backend
python -m venv venv
Then activate it.venv\Scripts\activatesource venv/bin/activate(venv) at the start of your terminal line once it works.
pip install -r requirements.txt
This installs Flask 3.1.0, TensorFlow 2.18.0, Pillow, Groq, requests and NumPy. TensorFlow alone is a few hundred MB, so on slow Wi-Fi go make chai.
set GROQ_API_KEY=your_groq_api_key
set OPENWEATHER_API_KEY=your_openweather_api_key
Windows (PowerShell):
$env:GROQ_API_KEY="your_groq_api_key"
$env:OPENWEATHER_API_KEY="your_openweather_api_key"
macOS / Linux:
export GROQ_API_KEY="your_groq_api_key"
export OPENWEATHER_API_KEY="your_openweather_api_key"
These only last for the current terminal window. Open a new one and you'll have to set them again.
python app.py
The first start takes a few seconds because the model is loading. When the terminal shows the server running, move on.
http://localhost:5001 in your browser. You should see the LeafLens home page.
http://localhost:5001/api/health. You should see {"status": "ok", "service": "LeafLens API"}. If you do, the backend is fine.dataset/raw_dataset/, for example a Snake Plant Anthracnose photo.python --version. Uninstall it, install Python 3.10.11 (64-bit), delete the venv folder, and redo steps 2 and 3.
python app.py from the wrong folder. The paths in config.py expect you to be inside backend/. Run cd into it and try again.
app.py, change the port number to something like 5002, and use that in the browser instead.
Still stuck? Message us with a screenshot of the error and we'll get on a call and sort it out.
Our team is here to assist you with installation and setup.