Skip to content

laurynas/utility-meter-digitizer

Repository files navigation

Utility Meter Digitizer

Digitize utility meter readings from photos using AI model.

Can be used with Home Assistant to digitize utility meter readings from camera. Integration component.

Also can be used with standalone ESP32-Cam which submits images directly to the digitizer.

This project is inspired by AI on the Edge device project, but the goal is a bit different:

  1. Take picture from any camera (even the cheapest ESP32CAM).
  2. No need for preselecting number positions or aligning - AI model detects automatically.

result

Demo

python demo.py

Server

Start server

gunicorn app:app

POST image using curl

curl -X POST --data-binary @samples/watermeter1.jpg http://localhost:8000/digitize

Docker

You can start the server on Docker like this:

docker run -p 8000:8000 kurmisrainas/utility-meter-digitizer

Also you can use docker-compose:

services:
  utility-meter-digitizer:
    image: kurmisrainas/utility-meter-digitizer
    ports:
      - 8000:8000

Model

Model was trained using YOLOv8 open source utility meters dataset from Roboflow.

yolo task=detect mode=train model=yolov8n.pt data=data.yaml epochs=100 imgsz=640 device=mps

device=mps enables GPU usage on MacBook for faster training.

Converting to onnx format

yolo export model=best.pt format=onnx

ESPHome

ESP32-Cam device configuration examples.

Credits

About

Digitize utility meter readings from photos

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published