https://github.com/gorav22/calory-advisor
https://github.com/gorav22/calory-advisor
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gorav22/calory-advisor
- Owner: Gorav22
- License: mit
- Created: 2025-01-24T06:52:40.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-01-24T07:03:17.000Z (8 months ago)
- Last Synced: 2025-01-24T07:29:01.288Z (8 months ago)
- Language: Python
- Homepage: https://gorav-calory-advisory.streamlit.app/
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Calorie Advisor App
This Streamlit app uses Google Gemini to estimate the calorie content of food from an uploaded image.
## Installation
1. **Clone the repository:**
```bash
git clone https://github.com/Gorav22/Calory-Advisor
```
2. **Install dependencies:**
```bash
pip install streamlit google-generativeai python-dotenv Pillow
```
3. **Set up a Google Gemini API Key:**
- Obtain an API key from [Google AI](https://developers.google.com/workspace/generative-ai).
- Create a `.env` file in the project directory and add the following line:
```
GOOGLE_API_KEY=YOUR_API_KEY
```## Usage
1. **Run the app:**
```bash
streamlit run app.py
```
2. **Upload an image:** Use the file uploader to select an image of food.
3. **(Optional) Add context:** Provide additional details in the input prompt.
4. **Click "Tell me about the total calories":** The app will send the image and prompt to Google Gemini and display the estimated calorie information.## How it Works
The app uses the `google-generativeai` library to interact with the Gemini API. It sends the uploaded image and user prompt to the model, which then returns a text response containing the calorie estimations. The `PIL` library is used for handling image uploads.
## Limitations
* Calorie estimations are based on visual analysis and may not be perfectly accurate.
* The app relies on the availability and performance of the Google Gemini API.## Contributing
Contributions are welcome! Feel free to open issues and pull requests.
## License
[MIT](LICENSE)