Skip to content

🍎πŸ₯¦ A smart web app that detects fruits and vegetables using YOLOv5 and PyTorch, and displays calorie information in real time.

Notifications You must be signed in to change notification settings

CodeWithQadeer/nutriscan_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯¦πŸŽ Fruits & Vegetables Detection App

PyTorch
Flask
YOLOv5

The Fruits & Vegetables Detection App is a Flask web application powered by a YOLOv5 deep learning model trained with PyTorch.
It detects 32+ classes of fruits and vegetables from images or webcam input and provides calorie information for each item.

This project highlights skills in Computer Vision, Flask Web Development, and AI-powered applications.


✨ Features

  • πŸ–ΌοΈ Upload Image Detection – Upload an image and get bounding boxes with detected fruits/vegetables.
  • πŸŽ₯ Live Webcam Detection – Real-time detection directly in the browser.
  • πŸ“¦ 32+ Supported Classes – Apple, Banana, Tomato, Mango, Potato, Strawberry, and more.
  • πŸ”Ž YOLOv5 Model – Custom-trained weights (best.pt) for accurate detection.
  • πŸ“Š Calorie Information – Each detected item shows nutritional values.
  • 🎨 Flask + HTML Templates – Lightweight UI with Bootstrap/Tailwind-ready design.

πŸ› οΈ Tech Stack

  • PyTorch – Deep learning framework
  • YOLOv5 – Object detection model
  • Flask – Web framework for serving the app
  • OpenCV / NumPy – Image processing utilities
  • HTML + Jinja2 – Templates for UI rendering

πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/your-username/fruits-vegetables-detection.git
cd fruits-vegetables-detection
  1. Install Dependencies
pip install -r requirements.txt
  1. Run the Flask App
python app.py
The app will start on http://127.0.0.1:5000/

πŸ“‚ Project Structure

fruits-vegetables-detection/
β”œβ”€β”€ images/                # Static images (hero, backgrounds, etc.)
β”‚   └── hero-bg.jpg
β”‚
β”œβ”€β”€ templates/             # HTML templates
β”‚   β”œβ”€β”€ index.html         # Home page (upload detection)
β”‚   β”œβ”€β”€ live.html          # Live webcam detection
β”‚   └── result.html        # Display results
β”‚
β”œβ”€β”€ weights/               # Model weights
β”‚   └── best.pt            # YOLOv5 trained model
β”‚
β”œβ”€β”€ app.py                 # Flask application
β”œβ”€β”€ data.yaml              # Dataset configuration file
β”œβ”€β”€ requirements.txt       # Python dependencies
└── README.md              # Project documentation

πŸ“ˆ Optimizations

Custom YOLOv5 training with 32 classes of fruits/vegetables.

Lightweight Flask API with minimal latency.

Reusable calorie lookup function.

Separate HTML templates for clean UI organization.

🌐 Deployment (Future Scope)

Backend (Flask) β†’ Deploy on Render, Heroku, or AWS EC2.

Frontend Templates β†’ Can be extended with React / modern UI later.

Configure environment variables for production.

🀝 Contributing Contributions are welcome! Fork this repo, create a branch, and submit a PR.

πŸ“œ License This project is licensed under the MIT License.

πŸ‘¨β€πŸ’» Author Built with ❀️ by Syed Abdul Qadeer Currently pursuing Full-Stack Web Development @ Masai School #dailylearning #masaiverse

πŸ”– Tags Flask Β· PyTorch Β· YOLOv5 Β· Computer Vision Β· Machine Learning Β· Deep Learning Β· Object Detection Β· Fruits Detection Β· Vegetables Detection Β· Calorie Tracking Β· Portfolio Project

About

🍎πŸ₯¦ A smart web app that detects fruits and vegetables using YOLOv5 and PyTorch, and displays calorie information in real time.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published