ciro-c commited on
Commit
a187b93
1 Parent(s): 20e3252

Upping space

Browse files
Files changed (8) hide show
  1. A.jpg +0 -0
  2. B.jpg +0 -0
  3. C.jpg +0 -0
  4. D.jpg +0 -0
  5. E.jpg +0 -0
  6. alfabot.keras +0 -0
  7. app.py +26 -0
  8. requirements.txt +7 -0
A.jpg ADDED
B.jpg ADDED
C.jpg ADDED
D.jpg ADDED
E.jpg ADDED
alfabot.keras ADDED
Binary file (918 kB). View file
 
app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import tensorflow as tf
3
+ import numpy as np
4
+ import matplotlib.image as mpimg
5
+ from tensorflow.keras import models
6
+
7
+
8
+ model = models.load_model('saved_model/my_model')
9
+ UPPERCASE_ALFABET = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
10
+
11
+ def predict(img):
12
+ image = mpimg.imread(img)
13
+ image = np.expand_dims(image, axis=0)
14
+ image_tensor = tf.constant(image, dtype=tf.float32)
15
+ result = model.predict(image_tensor)[0]
16
+ return UPPERCASE_ALFABET[np.argmax(result)]
17
+
18
+
19
+ gr.Interface(
20
+ fn=predict,
21
+ inputs=gr.inputs.Image(shape=(28, 28)),
22
+ outputs=gr.outputs.Label(num_top_classes=3),
23
+ title="Identificador de letras manuscritas",
24
+ description="Esse modelo tem a capacidade de identificar qual é a letra manuscrita.",
25
+ examples=["A.jpg","B.jpg","C.jpg","D.jpg","E.jpg"],
26
+ ).launch()
requirements.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ pip
2
+ gradio
3
+
4
+ numpy
5
+ tensorflow
6
+ matplotlib
7
+ tensorflow.keras