Skip to content
 
 

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🗑️ WasteVision AI

AI-powered waste detection, profit estimation, and environmental impact analysis

Python Next.js YOLOv8 Flask OpenStreetMap

Transforming how the world manages waste — one image at a time.


📖 Overview

WasteVision is a full-stack AI application that:

  • 📸 Detects and classifies waste in uploaded images using a custom-trained YOLOv8 model
  • 💰 Estimates scrap profit based on detected material types (plastic, metal, paper, glass)
  • 🌍 Calculates environmental impact — CO₂ saved, water conserved, energy recovered, trees saved
  • 📍 Finds nearby recycling centres and scrap dealers using OpenStreetMap / Overpass API
  • 🚛 Manages pickup requests with a dealer dashboard for accepting/rejecting orders

🏗️ Architecture

WasteVision/
│
├── backend/                    # Flask REST API (Python)
│   ├── app.py                  # Main application — all routes & logic
│   ├── requirements.txt        # Python dependencies
│   └── uploads/               # Runtime image uploads (gitignored)
│
├── frontend/                   # Next.js 16 Web Application (TypeScript)
│   ├── app/                    # App Router pages
│   │   ├── layout.tsx          # Root layout + theme provider
│   │   ├── page.tsx            # Main app entry (sidebar shell)
│   │   ├── globals.css         # Global styles + design tokens
│   │   └── dealer/
│   │       └── page.tsx        # Dealer dashboard page
│   ├── components/             # React components
│   │   ├── hero-section.tsx    # Landing hero with stats + animations
│   │   ├── upload-section.tsx  # Image upload + preview
│   │   ├── results-dashboard.tsx # Detection results display
│   │   ├── lower-sections.tsx  # Analytics, disposal plan
│   │   ├── nearby-dealers.tsx  # OSM map + dealer finder
│   │   ├── dealer-dashboard.tsx # Dealer pickup management
│   │   ├── history-section.tsx # Past analyses
│   │   ├── app-sidebar.tsx     # Navigation sidebar
│   │   ├── navbar.tsx          # Top navigation bar
│   │   ├── footer.tsx          # Footer component
│   │   ├── theme-provider.tsx  # Dark/light mode
│   │   └── ui/                 # shadcn/ui component library
│   ├── hooks/                  # Custom React hooks
│   ├── lib/                    # Utility functions
│   ├── public/                 # Static assets & icons
│   ├── styles/                 # Additional global styles
│   ├── next.config.mjs
│   ├── package.json
│   └── tsconfig.json
│
└── model/                      # AI model weights
    ├── best.pt                 # Custom YOLOv8 weights (download separately — see model/README.md)
    └── README.md               # Model info & download instructions

⚡ Quick Start

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • npm or pnpm

1. Clone the Repository

git clone https://github.com/your-username/WasteVision.git
cd WasteVision

2. Download the AI Model

See model/README.md for the download link.
Place best.pt in the model/ directory.

3. Set Up the Backend

cd backend
pip install -r requirements.txt
python app.py

The backend will start at http://localhost:5000

4. Set Up the Frontend

cd frontend
npm install
npm run dev

The frontend will start at http://localhost:3000

Open your browser and go to http://localhost:3000 🚀


🔌 Backend API Reference

Base URL: http://localhost:5000

Method Endpoint Description
POST /analyze Upload a waste image, get detection results
POST /upload Alias for /analyze
GET/POST /osm_locations Find nearby recycling centres (OpenStreetMap)
POST /request_pickup Submit a pickup request
GET /pickup_requests List all pickup requests (dealer view)
POST /accept_pickup Dealer accepts a pickup request
POST /reject_pickup Dealer rejects a pickup request
POST /complete_pickup Mark a pickup as completed
POST /dealer_login Dealer authentication

Example: Analyze Waste Image

curl -X POST http://localhost:5000/analyze \
  -F "file=@your_waste_image.jpg"

Response:

{
  "objects": { "plastic": 3, "metal": 1 },
  "profit": 110,
  "carbon_saved": 0.19,
  "water_saved": 13.4,
  "energy_saved": 1.0,
  "trees_saved": 0.0,
  "score": 100,
  "grade": "green",
  "suggestions": ["✅ Excellent segregation! Keep it up for maximum profit."],
  "recommendations": ["♻️ Send plastic to recycling center", "💰 Sell metal to scrap dealer"],
  "confidence": "High",
  "is_waste": true
}

🧠 AI Model

  • Architecture: YOLOv8n (nano — fast inference)
  • Training Dataset: TACO (Trash Annotations in Context)
  • Detected Classes: Bottle, Bottle cap, Plastic bag, Cup, Straw, Styrofoam, Can, Aluminium foil, Carton, Paper, Broken glass

Waste Categories & Scrap Values

Category Items Detected Value (₹/item)
🧴 Plastic Bottle, Bag, Cup, Straw, Styrofoam ₹20
🥫 Metal Can, Aluminium foil ₹50
📄 Paper Carton, Paper ₹10
🪟 Glass Broken glass ₹30

🌍 Maps & Location

WasteVision uses 100% free & open-source mapping:

No API keys required!


🎨 Tech Stack

Layer Technology
AI / ML YOLOv8 (Ultralytics), PyTorch
Backend Python 3.11, Flask 3.1, Flask-CORS
Frontend Next.js 16, TypeScript, Tailwind CSS
UI Components shadcn/ui, Radix UI
Maps OpenStreetMap, Nominatim, Overpass API
Styling CSS Modules, Tailwind, custom cyberpunk theme

🤝 Contributing

  1. Fork the repo
  2. Create your feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License. See LICENSE for details.


Built with ❤️ for a cleaner planet 🌍

About

Built an AI-powered waste management solution using YOLO-based computer vision to detect and classify waste as recyclable or non-recyclable from images. Developed a simple and accessible frontend interface for waste segregation and presented the solution at HACKFINITI 2026 in a competitive hackathon environment.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages