jeysshon commited on
Commit
1f74cd7
·
verified ·
1 Parent(s): 96e64da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -15,15 +15,14 @@ description = "Este modelo utiliza redes neuronales para clasificar diferentes e
15
  examples = ['3.jpg', '5.jpg', 'images.jpeg', '1.jpg', '2.jpg', '4.jpg', '6.jpg']
16
 
17
  # Crear la interfaz
18
- interface = gr.Interface(
19
- fn=predict,
20
- inputs=gr.Image(),
21
- outputs=gr.Label(num_top_classes=1),
22
- title=title,
23
- description=description,
24
- examples=examples,
25
- layout="vertical"
26
- )
27
 
28
  # Lanzar la interfaz
29
- interface.launch()
 
15
  examples = ['3.jpg', '5.jpg', 'images.jpeg', '1.jpg', '2.jpg', '4.jpg', '6.jpg']
16
 
17
  # Crear la interfaz
18
+ with gr.Blocks() as demo:
19
+ gr.Markdown(f"## {title}")
20
+ gr.Markdown(description)
21
+ with gr.Row():
22
+ image_input = gr.Image(type="pil")
23
+ label_output = gr.Label(num_top_classes=1)
24
+ image_input.upload(predict, inputs=image_input, outputs=label_output)
25
+ gr.Examples(examples=examples, inputs=image_input, outputs=label_output)
 
26
 
27
  # Lanzar la interfaz
28
+ demo.launch()