title | app_file | sdk | sdk_version |
---|---|---|---|
AI_NutriCoach |
app.py |
gradio |
5.12.0 |
AI NutriCoach is an AI-powered nutrition assistant that leverages advanced vision models and natural language processing to detect ingredients from food images, filter ingredients based on dietary restrictions, estimate calories, provide detailed nutrient analysis, and generate recipe suggestions. This project demonstrates the use of CrewAI, WatsonX, and other AI tools to deliver insightful and personalized nutritional feedback.
-
Ingredient Detection
Detects ingredients from user-uploaded images using a vision AI model. -
Dietary Filtering
Filters detected ingredients based on user-defined dietary restrictions (e.g., vegan, gluten-free). -
Calorie Estimation
Estimates total calories from the detected ingredients. -
Nutrient Analysis
Provides a detailed breakdown of key nutrients such as protein, carbohydrates, fats, vitamins, and minerals. -
Health Evaluation
Summarizes the overall healthiness of the meal and provides a health evaluation. -
Recipe Suggestion
Generates recipe ideas based on the filtered ingredients and dietary restrictions.
The project is built using the CrewAI framework, which organizes agents and tasks into workflows for two primary use cases:
-
Recipe Workflow
Detects ingredients, filters them based on dietary restrictions, and suggests recipes. -
Analysis Workflow
Directly estimates calories, performs nutrient analysis, and provides a health evaluation summary from a food image.
- Python 3.8+
- Virtual environment (optional but recommended)
- Git
- Clone the repository:
git clone https://github.com/HaileyTQuach/Smart-Nutritional-App.git cd Smart-Nutritional-App
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install the required dependencies:
pip install -r requirements.txt
- Create a .env file in the root directory with the following keys:
WATSONX_API_KEY=your_watsonx_api_key WATSONX_URL=your_watsonx_url WATSONX_PROJECT_ID=your_watsonx_project_id
You can run the application using the following commands:
- For recipe suggestions
python main.py <image_path> <dietary_restrictions> recipe
Example:
python main.py food.jpg vegan recipe
- For food analysis
python main.py <image_path> analysis
Example:
python main.py food.jpg analysis
- For training (future functionality - TODO)
python main.py train <n_iterations> <output_filename> <image_path> <dietary_restrictions> <workflow_type>
Smart-Nutritional-App-Crew/
│
├── config/
│ ├── agents.yaml # Configuration for agents
│ └── tasks.yaml # Configuration for tasks
│
├── src/
│ ├── crew.py # Crew definitions (agents, tasks, workflows)
│ ├── tools.py # Tool definitions for ingredient detection, filtering, etc.
│ └── main.py # Main script for running the application
│
├── requirements.txt # Python dependencies
└── README.md # Project documentation
Contributions are welcome! If you have suggestions for improvements or new features, please create a pull request or open an issue.
This project is licensed under the Hailey Thao Quach's Non-Commercial License. See the LICENSE
file for details.
For any questions or support, please contact Hailey Thao Quach.