DigitNet v2 Display Band
ONNX model for reading seven-segment displays
2 min read
This tool recognizes digits on seven-segment liquid crystal screens from local images (JPEG or PNG) using specified block coordinates. The model is based on DigitNet v2 weights by Chakib Belgaid, adapted to run on a CPU in ONNX format (while adding background evaluation for the entire display band and preserving core external readings). It accepts character crops as input, outputting probabilities for numbers from 0 to 9 or a non-digit flag at a confidence threshold of 0.60. This solution benefits developers of smart meters, IoT systems, and offline autonomous applications for automated meter reading.
Key features
- Lightweight architecture: contains only 10,123 parameters with an ONNX file size of 42,410 bytes.
- Offline operation: completely autonomous execution on a CPU after a one-time download of dependencies and the archive.
- Hybrid approach: allows re-evaluating bounding boxes rejected by the primary classifier.
- Convenient distribution: the archive includes launch scripts, sample images, and JSON annotations.
What you can do
- Utility automation: integrate the model into a local image processing pipeline for electricity or water meters.
- Fine-tuning and testing: evaluate recognition accuracy on custom datasets with digit coordinates.
- IoT integration: use the lightweight ONNX file in custom Python applications for edge devices.
Example
curl -fL '[https://modelscope.cn/models/nano0412/inchwork-digitnet-v2-display-band-onnx/resolve/v0.1.0/digitnet-display-band-cpu-v0.1.0.zip](https://modelscope.cn/models/nano0412/inchwork-digitnet-v2-display-band-onnx/resolve/v0.1.0/digitnet-display-band-cpu-v0.1.0.zip)' -o digitnet.zip
python3.12 -m zipfile -e digitnet.zip .
cd E-009-P-digitnet-cpu
python3.12 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
.venv/bin/python digitnet_pilot.py examples/display.png examples/boxes.jsonRead more
Details• Architecture: uint8 tensor input [N,1,32,24], where 0 is background and 255 represents the deepest strokes.
• Output: probabilities [N,11] with a class activation threshold ≥0.60.
• Benchmarks: on a test set of 904 bounding boxes, the base DigitNet achieved 737 correct answers and 166 rejections (increasing up to 790 correct answers when combined with a fallback method).
• Requirements: Python 3.12, runs on a standard CPU with no GPU required.










Comments