https://github.com/muhammad-fiaz/swms
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.
https://github.com/muhammad-fiaz/swms
ewaste-management-system machine-learning pyqt pyqt6 python python3 pytorch smart-waste-management-system tensorflow waste-management-system
Last synced: 2 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/muhammad-fiaz/swms
- Owner: muhammad-fiaz
- License: mit
- Created: 2025-04-07T12:52:13.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-04-07T14:02:29.000Z (2 months ago)
- Last Synced: 2025-04-07T14:23:02.017Z (2 months ago)
- Topics: ewaste-management-system, machine-learning, pyqt, pyqt6, python, python3, pytorch, smart-waste-management-system, tensorflow, waste-management-system
- Language: Python
- Homepage:
- Size: 263 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
โป๏ธ Smart Waste Management System (SWMS)
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.
---
## ๐ Features
- ๐ง 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---
## ๐ฆ Installation
> Requires Python 3.12+
```bash
pip install -r requirements.txt
```Or using [`pyproject.toml`](pyproject.toml):
```bash
pip install .
```---
## ๐ ๏ธ Usage
### ๐ง Train the model
Place your CSV files in `Datasets/` (e.g. `Datasets/data1.csv`), then:
```bash
python detect.py --train
```### ๐ผ๏ธ Analyze an image via GUI
```bash
python detect.py --gui
```### ๐ผ๏ธ Analyze an image via command-line
```bash
python detect.py --image path/to/image.jpg
```---
## ๐ Dataset Format for Training
CSV files should be like:
```csv
label,plastic,metal,glass
phone,42,38,20
bottle,100,0,0
```- `label`: The item name (must match YOLOS labels; you can list them by running `python detection_items.py`)
- `plastic`, `metal`, `glass`: Composition percentages (should sum to ~100).---
## ๐ง Model
- **Object Detection**: `hustvl/yolos-base` (transformers)
- **Composition Predictor**: PyTorch feed-forward model trained from CSV data
- **File Format**: `.safetensors`---
## ๐ธ Project Structure
```text
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
```## ๐ Output Report Example
```
Detected Items 1 in image.jpg:
- cell phoneEstimated Recyclable Components:
Plastic: 42%
Metal: 38%
Glass: 20%โป๏ธ Waste Classification:
โ Degradable Waste: 0%
โ Non-Degradable Waste: 100%
----------------------------------------
```---
## ๐ชช License
This project is licensed under the [MIT License](LICENSE).
---
## ๐ค Contributing
Pull requests are welcome! For major changes, please open an issue first.