nivashuggingface commited on
Commit
71f1563
·
verified ·
1 Parent(s): e3e8f0b

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +48 -0
README.md ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: mit
4
+ tags:
5
+ - tensorflow
6
+ - image-classification
7
+ - mnist
8
+ - digits
9
+ datasets:
10
+ - mnist
11
+ metrics:
12
+ - accuracy
13
+ ---
14
+
15
+ # Digit Recognition Model
16
+
17
+ This model is trained to recognize handwritten digits from the MNIST dataset.
18
+
19
+ ## Model Description
20
+
21
+ - **Model Type:** CNN with Attention
22
+ - **Task:** Image Classification
23
+ - **Input:** 28x28 grayscale images
24
+ - **Output:** Digit classification (0-9)
25
+
26
+ ## Training
27
+
28
+ The model was trained on the MNIST dataset using a CNN architecture with attention mechanisms.
29
+
30
+ ## Usage
31
+
32
+ ```python
33
+ import tensorflow as tf
34
+ import numpy as np
35
+
36
+ # Load the model
37
+ model = tf.saved_model.load("path_to_saved_model")
38
+
39
+ # Prepare input
40
+ image = tf.keras.preprocessing.image.load_img("digit.png", target_size=(28, 28))
41
+ image = tf.keras.preprocessing.image.img_to_array(image)
42
+ image = image.astype('float32') / 255.0
43
+ image = np.expand_dims(image, axis=0)
44
+
45
+ # Make prediction
46
+ predictions = model(image)
47
+ predicted_digit = tf.argmax(predictions, axis=1).numpy()[0]
48
+ ```