An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

        


preview

โ™ป๏ธ 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 phone

Estimated 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.