NutriGenie is a personal nutrition assistant application that allows users to analyze food items from images and calculate their total calories. This README file provides detailed instructions on setting up and running the project.
- Analyze food items from images
- Calculate total calories of food items
- Display nutritional assessment including details of food items and their calorie counts
To get started with NutriGenie, follow these instructions:
- Python 3.x installed on your system.
- A Google Gemini Pro Vision API key.
-
Clone this repository to your local machine:
git clone https://github.com/shihabcodes/NutriGenie.git
-
Navigate to the project directory:
cd NutriGenie
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
-
On Windows:
venv\Scripts\activate
-
On macOS and Linux:
source venv/bin/activate
-
-
Install the required Python packages:
pip install -r requirements.txt
-
Obtain a Google Gemini Pro Vision API key and set it in a
.env
file in the project directory:GOOGLE_API_KEY=<your_api_key>
To run NutriGenie, execute the following command in your terminal within the project directory:
streamlit run app.py
- Once the application is running, you will see the NutriGenie interface in your browser.
- Enter your question or instruction related to nutrition in the provided text input field.
- Upload an image containing food items by clicking on the "Choose an image..." button.
- Click on the "Analyze Nutrition" button to initiate the analysis.
- The application will process the input and display the nutritional assessment, including details such as food items detected in the image and their respective calorie counts.
Contributions are welcome! Please follow these steps:
- Fork the project.
- Create a new branch (
git checkout -b feature/awesome-feature
). - Commit your changes (
git commit -m 'Add awesome feature'
). - Push to the branch (
git push origin feature/awesome-feature
). - Open a pull request.
- Ensure that the uploaded image contains clearly visible food items for accurate analysis.
- Be descriptive while entering your question or instruction to receive relevant nutritional information.
The following Python packages are used in this project:
- Streamlit: For building and deploying web applications.
- Google GenerativeAI: For integrating with Google Gemini Pro Vision API.
- python-dotenv: For loading environment variables from a .env file.
- langchain: For language processing tasks.
- PyPDF2: For working with PDF files.
- chromadb: For managing Chrome browser instances.
- pdf2image: For converting PDF files to images.
- faiss-cpu: For efficient similarity search and clustering of dense vectors.
- langchain_google_genai: For language processing using Google GenerativeAI.
This project is licensed under the MIT License - see the LICENSE file for details.