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:
- Take picture from any camera (even the cheapest ESP32CAM).
- No need for preselecting number positions or aligning - AI model detects automatically.
python demo.pyStart server
gunicorn app:appPOST image using curl
curl -X POST --data-binary @samples/watermeter1.jpg http://localhost:8000/digitizeYou can start the server on Docker like this:
docker run -p 8000:8000 kurmisrainas/utility-meter-digitizerAlso you can use docker-compose:
services:
utility-meter-digitizer:
image: kurmisrainas/utility-meter-digitizer
ports:
- 8000:8000Model 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=mpsdevice=mps enables GPU usage on MacBook for faster training.
Converting to onnx format
yolo export model=best.pt format=onnxThere is a secondary model added from another roboflow dataset which some users have found more successful. That can be activated by adding the environment variable MODEL_PATH=models/white-numbers.v2i.yolov8.onnx
ESP32-Cam device configuration examples.
- Utility meters dataset from Roboflow
- ONNX YOLOv8 Object Detection by Ibai Gorordo
