Git Product home page Git Product logo

detect-and-read-meters's Introduction

Detect and Read meters in the wild

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.

Visulization results

Left row is the original image, middle row is the process of meter rectification, right row is the result of meter value reading.

ToDo List

  • 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

Installation

Requirements:

  • Python3 (Python3.7 is recommended)
  • PyTorch >= 1.0
  • torchvision from master
  • numpy
  • skimage
  • OpenCV==3.0.x
  • CUDA >= 9.0 (10.0 is recommended)

Meter Detection

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.

Meter Alignment

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

Meter Recognition

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

Demo

You can run a demo script for a single image inference.

python predict_online.py

Paper

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}
}

detect-and-read-meters's People

Contributors

shuyansy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.