An intelligent system to detect, classify, and analyze waste using AI-powered object detection and material composition prediction. This project combines YOLOS object detection with a custom-trained classifier to identify and categorize waste as degradable or non-degradable.
- 🧠 Object detection using YOLOS (Vision Transformer)
- 📊 Predicts plastic, metal, and glass composition
- 🔍 Classifies waste as Degradable or Non-Degradable
- 📤 Simple drag-and-drop GUI using PyQt6
- 📁 CLI support for training, single-image analysis, and GUI mode
- 🧪 Easily extensible dataset-based training
- ✅ MIT Licensed & open source
Requires Python 3.12+
pip install -r requirements.txtOr using pyproject.toml:
pip install .Place your CSV files in Datasets/ (e.g. Datasets/data1.csv), then:
python detect.py --trainpython detect.py --guipython detect.py --image path/to/image.jpgCSV files should be like:
label,plastic,metal,glass
phone,42,38,20
bottle,100,0,0label: The item name (must match YOLOS labels; you can list them by runningpython detection_items.py)plastic,metal,glass: Composition percentages (should sum to ~100).
- Object Detection:
hustvl/yolos-base(transformers) - Composition Predictor: PyTorch feed-forward model trained from CSV data
- File Format:
.safetensors
assets/
└── logo.png # Logo image
datasets/ # Dataset folder
└── data1.csv # dataset example 1
└── data2.csv # dataset example 2
.gitignore # Git ignore file
detect.py # main detection script
LICENSE # License file
pyproject.toml # Project metadata
README.md # Project documentation
uv.lock # Dependency lock file
requirements.txt # Python dependencies
label2idx.json # Encoded label mappings (used by the model)
model.safetensors # Trained model weights
Detected Items 1 in image.jpg:
- cell phone
Estimated Recyclable Components:
Plastic: 42%
Metal: 38%
Glass: 20%
♻️ Waste Classification:
✅ Degradable Waste: 0%
❗ Non-Degradable Waste: 100%
----------------------------------------
This project is licensed under the MIT License.
Pull requests are welcome! For major changes, please open an issue first.
