Skip to content

Commit

Permalink
Add another model and make it a configurable parameter (#3)
Browse files Browse the repository at this point in the history
* Add files via upload

* allow model to be configurable with environment variable

* Update README.md

* Update README.md
  • Loading branch information
chrisns authored Feb 8, 2025
1 parent 1283f1f commit 8bf263a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ Converting to onnx format
yolo export model=best.pt format=onnx
```

There is a secondary model added from another [roboflow dataset](https://universe.roboflow.com/numbers-for-electric-meters/white-numbers) which some users have found more successful. That can be activated by adding the environment variable `MODEL_PATH=models/white-numbers.v2i.yolov8.onnx`

## ESPHome

ESP32-Cam device [configuration examples](https://github.com/laurynas/esphome-devices/).
Expand Down
3 changes: 2 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import os
from PIL import Image
from src.digitizer import Digitizer
from src.routing import IdentifierConverter
Expand All @@ -8,7 +9,7 @@
from glob import glob
from flask import Flask, request, send_file

model = 'models/yolov8-detect-20240229.onnx'
model = os.getenv("MODEL_PATH", "models/yolov8-detect-20240229.onnx")
data_dir = 'data/'

digitizer = Digitizer(model)
Expand Down
Binary file added models/white-numbers.v2i.yolov8.onnx
Binary file not shown.

0 comments on commit 8bf263a

Please sign in to comment.