Vision Language Model for Dietary Analysis is a cutting-edge application that leverages Google's Gemini Pro Vision API to analyze images of food and provide detailed dietary information. The app uses an advanced Vision Language Model (VLM) to identify food items in an image, calculate their calorie content, and deliver a comprehensive nutritional breakdown.
- Image-Based Food Analysis: Upload an image of your meal, and the app will identify each food item.
- Calorie Calculation: The app calculates the total calorie intake based on the identified food items.
- Detailed Nutritional Information: Get a breakdown of calories per food item for better dietary management.
- Streamlit Integration: A user-friendly interface built with Streamlit for easy access and use.
- Google Gemini Pro Vision API: For food recognition and analysis.
- Streamlit: Web framework for building the app interface.
- Python: Core programming language used.
- Pillow (PIL): For image handling and processing.
- dotenv: For environment variable management.
- Python 3.7+
- Google Cloud API Key with access to Gemini Pro Vision API
-
Clone this repository:
git clone https://github.com/yourusername/vision-language-model-dietary-analysis.git cd vision-language-model-dietary-analysis
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set up your environment variables:
- Create a
.env
file in the root directory. - Add your Google API key:
GOOGLE_API_KEY=your_google_api_key_here
- Create a
-
Run the Streamlit app:
streamlit run app.py
-
Upload an image of a meal.
-
Enter any specific input prompt if needed.
-
Click "Tell me the total calories" to get a detailed analysis of the food items and their calorie content.
When you upload an image and submit it, the app will return:
Contributions are welcome! Please fork this repository, make your changes, and submit a pull request.
For any inquiries or issues, please contact ayushkumawat2112@gmail.com.