# Rwanda Water Meter Reading System
An AI-based computer vision project for automatic water meter detection and reading using YOLO object detection.
This project includes:
- dataset collection
- image labeling
- dataset preparation
- YOLO training
- retraining
- prediction
- reading reconstruction
The system is trained to detect:
- water meter
- reading window
- digits `0–9`
- unclear digits (`unknown`)
---
# Features
The project provides tools for:
- collecting water meter datasets
- labeling water meter images
- rotating and cleaning images
- validating YOLO datasets
- preparing train/val/test datasets
- training YOLO models
- retraining from latest best model
- predicting on test images
- reconstructing final meter readings
---
# Project Structure
```text
rwanda-water-meter-reading-system/
├── raw_dataset/
│ ├── images/
│ └── labels/
│
├── dataset/
│ ├── images/
│ │ ├── train/
│ │ ├── val/
│ │ └── test/
│ │
│ ├── labels/
│ │ ├── train/
│ │ ├── val/
│ │ └── test/
│ │
│ ├── reports/
│ └── data.yaml
│
├── scripts/
│ ├── 01_label_images.py
│ ├── 02_prepare_yolo_dataset.py
│ ├── 03_train_yolo.py
│ ├── 04_predict_on_test_images.py
│ └── 05_retrain.py
│
├── training_runs/
├── prediction_outputs/
└── README.md
```
---
# Supported Classes
| Class ID | Class Name | Description |
|---|---|---|
| 0 | meter | Full physical water meter |
| 1 | window | Reading/display window |
| 2 | 0 | Digit 0 |
| 3 | 1 | Digit 1 |
| 4 | 2 | Digit 2 |
| 5 | 3 | Digit 3 |
| 6 | 4 | Digit 4 |
| 7 | 5 | Digit 5 |
| 8 | 6 | Digit 6 |
| 9 | 7 | Digit 7 |
| 10 | 8 | Digit 8 |
| 11 | 9 | Digit 9 |
| 12 | unknown | Unclear/unreadable digit |
---
# Installation
## Install dependencies
```bash
pip install ultralytics
pip install opencv-python
pip install PySide6
```
---
# Dataset Structure
Expected raw dataset structure:
```text
raw_dataset/
├── images/
└── labels/
```
Example:
```text
raw_dataset/
├── images/
│ ├── wm_0001.jp …