The Diet Assist App is an AI-powered tool designed to help users make informed dietary decisions. The app allows users to upload an image of food, detects whether it contains a specific type of food, and provides a health recommendation based on the user’s dietary goals. The app also includes text-to-speech functionality to audibly deliver the recommendation.
- Image Upload: Users can upload images in JPEG or PNG formats.
- Food Detection: The app detects whether the uploaded image contains food.
- Food Classification: Identifies the specific type of food in the image.
- Health Recommendations: Offers advice on whether to eat the detected food based on health goals.
- Text-to-Speech: Converts the recommendation to speech and plays the audio within the app.
- Python 3.10 or higher
- Poetry (for dependency management)
Clone the repository to your local machine:
git clone https://github.com/sagi-ezri/diet-assist.git
cd diet-assist
Use Poetry to install the required dependencies:
poetry install
This will install all the dependencies specified in the pyproject.toml
file.
To run the application, use the following command:
poetry run streamlit run app.py
This will start a local Streamlit server, and you can access the app in your web browser at http://localhost:8501
.
- Upload an Image: Click on "Choose an image..." to upload a JPEG or PNG file.
- View the Image: The uploaded image will be displayed within the app.
- Detection and Classification: The app will analyze the image to detect and classify any food present.
- Health Recommendation: If food is detected, the app will generate a recommendation on whether you should eat the food.
- Listen to the Recommendation: The recommendation will be converted to speech and played back within the app.
To run the tests, use the following command:
poetry run pytest tests/
This command will execute the test cases located in the tests/
directory.
Contributions are welcome! If you'd like to contribute to this project, please fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE
file for more details.
- The app uses the
gTTS
library for text-to-speech functionality. - The food detection model is powered by PyTorch.
- The health recommendation feature is supported by the OpenAI API.
Thank you for using the Diet Assist App! If you have any questions or feedback, please feel free to contact us.