Spaces:
Runtime error
Runtime error
Ignahugging
commited on
Commit
•
cb92cf8
1
Parent(s):
f61ff98
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import tensorflow as tf
|
2 |
import gradio as gr
|
|
|
3 |
|
4 |
modelo =tf.keras.models.load_model('model_0.h5')
|
5 |
#modelo.load_weights("model_0_weights.h5")
|
@@ -8,7 +9,7 @@ classes=['daisy','dandelion','roses','sunflowers','tulips']
|
|
8 |
def classifier(image):
|
9 |
pred_img = model.predict(tf.expand_dims(image,axis=0))
|
10 |
pred_img = tf.squeeze(tf.round(pred_img))
|
11 |
-
texto = f'Predicted label: {class_id[(np.argmax(pred_img))]}'
|
12 |
return texto
|
13 |
|
14 |
interface = gr.Interface(classifier,gr.inputs.Image(shape=(1024,1024)),outputs = "text",
|
|
|
1 |
import tensorflow as tf
|
2 |
import gradio as gr
|
3 |
+
import numpy as np
|
4 |
|
5 |
modelo =tf.keras.models.load_model('model_0.h5')
|
6 |
#modelo.load_weights("model_0_weights.h5")
|
|
|
9 |
def classifier(image):
|
10 |
pred_img = model.predict(tf.expand_dims(image,axis=0))
|
11 |
pred_img = tf.squeeze(tf.round(pred_img))
|
12 |
+
texto = str(f'Predicted label: {class_id[(np.argmax(pred_img))]}')
|
13 |
return texto
|
14 |
|
15 |
interface = gr.Interface(classifier,gr.inputs.Image(shape=(1024,1024)),outputs = "text",
|