Views
No views yet
۰۱۲۳۴۵۶۷۸۹ —
trained on 80,000 real handwritten digit images.digit_classifier_handwritten.keras)Mehdinmz/persian-handwritten-digits1from huggingface_hub import hf_hub_download
2import tensorflow as tf
3import numpy as np
4
5path = hf_hub_download("Mehdinmz/persian-handwritten-digit-recognition", "digit_classifier_handwritten.keras")
6model = tf.keras.models.load_model(path)
7
8# img: 28x28 grayscale float32 in [0,1]
9pred = model.predict(img.reshape(1, 28, 28, 1), verbose=0)
10digit = int(np.argmax(pred)) # 0..9 (Persian digit: ۰۱۲۳۴۵۶۷۸۹)| Metric | Value |
|---|---|
| Test accuracy | 99.8% |
| Per-class (200 imgs each) | ≥ 99.5% for all classes |