This is areleased system towards detection and recognition of complex meters in wild. The system can be divided into three moduels. Fisrtly, a yolo-based detector is applied to get pure meter region. Secondly, a spatial transformer module is eatablished to rectify the position of meter. Lastly, an end-to-end network is to read meter values, which is implemented by pointer/dail predcition and key number learning.
Left row is the original image, middle row is the process of meter rectification, right row is the result of meter value reading.
- Release testing code
- Release training code and dataset
- existing three-stage models
- A new branch for digital-meter recognition
- Document for testing
- Document for training
- Demo script for single image
- Python3 (Python3.7 is recommended)
- PyTorch >= 1.0
- torchvision from master
- numpy
- skimage
- OpenCV==3.0.x
- CUDA >= 9.0 (10.0 is recommended)
We use official YOLO-V5 to detect meters.
We release a dataset for training model, which can be downloaded from data_detection The data is COCO-format and label 0 and 1 represent pointer meters and digital meters.
We also provide trained weight in yolo_weight You dan put it in the yolov5 folder for inference.
We implement meter alignment by STN network. However, we obseve it is time-consuming. Thus we remove it in the latest version. You can still find it in the master branch. We also provide the weight you can refer in alignment weight
We design a network for read meters, which consists of a pointer prediction head, dail prediction head, and a ocr-based value prediction head. By a post-processing method, meter readings can be obtained.
The dataset for training the network has been realsed in data the data is annotated by Labelme tool. "Train" folder contains pointer and dail information, and "Train1" folder contains value information.
You can run python viz_label.py
to visualize different annotations.
You can run python train.py
to train your own dataset. The training configurations are in util/option.py
We also provide trained weight in read_weight You should put it in the model/meter_data
You can run a demo script for a single image inference.
python predict_online.py
The project only for academic research, if you are interested in it, please star our project! And cite our paper as follows:
@misc{shu2023read,
title={Read Pointer Meters in complex environments based on a Human-like Alignment and Recognition Algorithm},
author={Yan Shu and Shaohui Liu and Honglei Xu and Feng Jiang},
year={2023},
eprint={2302.14323},
archivePrefix={arXiv},
primaryClass={cs.CV}
}