In today's fast-paced world, maintaining a healthy diet is becoming increasingly challenging. People often struggle with:
- Identifying the nutritional content of their meals
- Making informed food choices
- Tracking their daily nutritional intake
- Understanding the impact of their food choices on their health
Traditional methods of nutritional analysis are:
- Time-consuming
- Error-prone
- Require manual input
- Often inaccessible in real-time
Nutrivision aims to solve these challenges by providing an automated, accurate, and user-friendly solution for food image classification and nutritional analysis.
Nutrivision is an innovative food image classification system that uses computer vision to identify food items and provide nutritional information. The project combines machine learning models with a user-friendly web interface to help users understand the nutritional content of their meals.
Nutrivision/
├── NutriVision Main Website/ # Main website frontend
├── template/ # Flask templates
├── models/ # Trained ML models
├── app.py # Flask backend application
└── ViT_predicting_food_images.ipynb # Model training notebook
- Food image classification using Vision Transformer (ViT) model
- Real-time nutritional information display
- User-friendly web interface
- Flask-based backend server
- Integration with nutrition databases
- Python 3.8+
- Flask
- PyTorch
- OpenCV
- NumPy
- Pandas
- Clone the repository:
git clone https://github.com/phoenixdev100/CyberKnights-NutriVision.git
cd CyberKnights-NutriVision- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt-
Before running app file make sure to add gemini api key to app.py file
-
Start the Flask server:
python app.py- Open your web browser and navigate to:
http://localhost:5000
- Upload a food image and get instant nutritional analysis
- Contains the main frontend code
- HTML, CSS, and JavaScript files
- User interface components
- Static assets (images, stylesheets)
- Navigate to the main website directory:
cd "NutriVision Main Website"
python -m http.server- Install required frontend dependencies:
npm install # If using Node.js
# or
pip install -r requirements.txt # If using Python packages- Start the development server:
# For Node.js projects:
npm start
# or
npm run dev
# For Python projects:
python manage.py runserver
# or
flask run- Access the website:
- Open your web browser
- Navigate to:
http://localhost:3000(for Node.js) orhttp://localhost:5000(for Python) - The main interface should be visible with options to:
- Upload food images
- View nutritional analysis
- Access food database
- View user profile
- Development Tips:
- Make sure the backend server (app.py) is running simultaneously
- Check browser console for any errors
- Ensure all API endpoints are properly configured
- Test image upload functionality
- Verify nutritional data display
- Flask template files
- HTML templates for different pages
- Layout components
- Form templates
- Main Flask application
- API endpoints
- Model integration
- Image processing functions
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Vision Transformer (ViT) model
- Food-101 dataset
- Flask framework
- PyTorch community