How akhilpm156/tomato_leaf_disease_classification-with-streamlit works
Project type and purpose
• This is a single‐page web application (full‐stack, though very light on the “stack”) built with Streamlit.
• Its sole purpose is: accept a tomato leaf image, run it through a pre‐trained Keras model (tomato_model.h5), and display one of six disease/health predictions.
File structure
• Top level
• .devcontainer/: VS Code development container configuration (defines your dev environment).
• .gitignore, README.md
• app.py: Streamlit entry point (combines frontend & backend logic).
• requirements.txt: Python dependencies (TensorFlow/Keras, Streamlit, etc.).
• tomato_model.h5: Serialized ML model.
• tomato_plant_leaf_disease_classification.ipynb: exploratory notebook (data preprocessing & model training).
• test_image/: sample images used in testing or demos.
README for additional insights
• Confirms Streamlit web app, local launch (streamlit run app.py), use of Kaggle “Plant Village” dataset, live deployment on Streamlit Cloud.
a. Main components
1. User’s Browser (client)
2. Streamlit Server (app.py) – handles HTTP, UI rendering, file upload widget.
3. Prediction Service – code within app.py that loads tomato_model.h5 via Keras/TensorFlow.
4. Model Store – the .h5 file residing on disk.
5. Dev Container (optional) – Docker‐based environment defined in .devcontainer/devcontainer.json.
6. External Dataset (Kaggle) – for context/training (optional, outside runtime).
b. Relationships and interactions
• Client → Streamlit Server: user uploads image, clicks “Predict.”
• Streamlit Server → Prediction Service: passes image array to model.
• Prediction Service → Model Store: loads weights from tomato_model.h5.
• Prediction Service → Streamlit Server: returns class probabilities/labels.
• Streamlit Server → Client: renders prediction result in browser.
c. Architectural patterns/design principles
• Single‐process web server (UI + business logic together).
• Model‐driven classification pipeline.
• Dev container for environment reproducibility (Infrastructure as Code).
d. Key technologies/frameworks
• Streamlit (UI & web server)
• Python 3.x, Keras/TensorFlow (model inference)
• Docker/Dev Container (developer environment)
• Requirements: listed in requirements.txt
Detail and essential elements
• Technology (e.g., “Streamlit (app.py)”).
• If including the Jupyter notebook, mark it as separate “Training/Research” component, not in the runtime path.