This project is a Flask-based web application that analyzes images of fruits and vegetables to determine their freshness and provides personalized recipe suggestions based on the analyzed ingredients and other available ingredients input by the user.
The application uses a deep learning model to classify whether a fruit or vegetable is fresh or rotten. Based on the classification and other ingredients provided by the user, the system recommends healthy recipes.
- Upload and analyze images of fruits and vegetables
- Detect freshness status of produce using a trained machine learning model
- Identify the type of fruit/vegetable in the image
- Input additional available ingredients
- Receive personalized recipe recommendations based on the freshness status and available ingredients
- Optimize food usage by suggesting appropriate recipes for less-fresh produce
- Backend: Flask (Python web framework)
- Machine Learning: TensorFlow
- Frontend: HTML, CSS, JavaScript
- Data Processing: NumPy, Pillow
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── model/ # Trained ML model directory
│ └── model.h5 # Trained model file
├── static/ # Static assets
│ ├── css/ # Stylesheets
│ ├── js/ # JavaScript files
│ └── uploads/ # Uploaded images
├── templates/ # HTML templates
│ ├── index.html # Main page template
│ └── result.html # Results page template
└── utils/ # Utility modules
├── freshness.py # Freshness detection module
└── recipes.py # Recipe recommendation module
- Python 3.8 or higher
- pip (Python package manager)
-
Clone the repository:
git clone <repository-url> cd <repository-directory> -
Install the required dependencies:
pip install -r requirements.txt -
Download the model file:
- The model file (model.h5) can be downloaded from this link
- Place the model file in the
model/directory
-
Make sure the model file is in the correct location (
model/model.h5) -
Start the Flask server:
python app.py -
Open a web browser and navigate to:
http://127.0.0.1:5000/
The model was trained on the Fruits and Vegetables Image Recognition Dataset. The dataset includes images of fresh and rotten fruits and vegetables for classification purposes.
The dataset and project resources can be accessed from:
Additional project documents and resources are available at:
- On the homepage, upload an image of a fruit or vegetable
- Enter any additional ingredients you have available (comma-separated)
- Submit the form to get analysis results
- View the freshness analysis and recipe recommendations tailored to your ingredients
To extend this project, you can:
- Add more sophisticated image recognition models
- Expand the recipe database
- Implement user accounts to save favorite recipes
- Integrate with grocery shopping APIs
- Add nutritional information to recipes
This project is licensed under the MIT License - see the LICENSE file for details.