Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
from tensorflow.keras.models import load_model
|
4 |
-
from tensorflow.keras.preprocessing.image import
|
5 |
|
6 |
# Cargar el modelo .keras
|
7 |
model = load_model('cnn_covid.keras')
|
@@ -22,7 +22,7 @@ def predict_image(image):
|
|
22 |
|
23 |
# Crear la interfaz de Gradio
|
24 |
iface = gr.Interface(fn=predict_image,
|
25 |
-
inputs=gr.
|
26 |
outputs="text",
|
27 |
live=True)
|
28 |
|
@@ -31,7 +31,7 @@ def show_link():
|
|
31 |
return "If you don't have an image, please download one from this link: https://drive.google.com/drive/folders/1Dr11dKuSlgtWaTzNLRixzB19y588iNib?usp=sharing"
|
32 |
|
33 |
# Agregar el enlace en la interfaz de salida
|
34 |
-
iface.add_component(gr.
|
35 |
|
36 |
# Lanzar la interfaz
|
37 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
from tensorflow.keras.models import load_model
|
4 |
+
from tensorflow.keras.preprocessing.image import img_to_array
|
5 |
|
6 |
# Cargar el modelo .keras
|
7 |
model = load_model('cnn_covid.keras')
|
|
|
22 |
|
23 |
# Crear la interfaz de Gradio
|
24 |
iface = gr.Interface(fn=predict_image,
|
25 |
+
inputs=gr.Image(type="pil"),
|
26 |
outputs="text",
|
27 |
live=True)
|
28 |
|
|
|
31 |
return "If you don't have an image, please download one from this link: https://drive.google.com/drive/folders/1Dr11dKuSlgtWaTzNLRixzB19y588iNib?usp=sharing"
|
32 |
|
33 |
# Agregar el enlace en la interfaz de salida
|
34 |
+
iface.add_component(gr.Textbox(label="Link", value=show_link()))
|
35 |
|
36 |
# Lanzar la interfaz
|
37 |
iface.launch()
|