Aarón Espasandín commited on
Commit
3674354
1 Parent(s): a4b2962

Changes related to Gradio update

Browse files
Files changed (2) hide show
  1. app.py +7 -6
  2. requirements.txt +3 -3
app.py CHANGED
@@ -89,13 +89,14 @@ def predict(input_image:Image.Image, true_label:str):
89
  interface = gr.Interface(
90
  fn=predict,
91
  inputs=[
92
- gr.inputs.Image(label="Input Image", type="pil"),
93
- "text"
94
  ],
95
  outputs=[
96
- gr.outputs.Label(label="Class"),
97
- "text",
98
- gr.outputs.Image(label="Face with Explainability", type="numpy")
99
  ],
100
- examples=[[examples[i]["path"], examples[i]["label"]] for i in range(10)]
 
101
  ).launch()
 
89
  interface = gr.Interface(
90
  fn=predict,
91
  inputs=[
92
+ gr.components.Image(label="Input Image", type="pil"), # Updated component import and type
93
+ gr.components.Text(label="Your Text Input") # Updated component import
94
  ],
95
  outputs=[
96
+ gr.components.Label(label="Class"), # Updated component import
97
+ gr.components.Text(label="Your Text Output"), # Updated component import
98
+ gr.components.Image(label="Face with Explainability", type="numpy") # Updated component import and type
99
  ],
100
+ examples=[[examples[i]["path"], examples[i]["label"]] for i in range(10)],
101
+ cache_examples=True # Adjusted according to the new parameter for caching examples if needed
102
  ).launch()
requirements.txt CHANGED
@@ -1,6 +1,6 @@
1
- gradio==3.14.0
2
  Pillow
3
- facenet-pytorch==2.5.2
4
- torch==1.11.0
5
  opencv-python
6
  grad-cam
 
1
+ gradio
2
  Pillow
3
+ facenet-pytorch
4
+ torch
5
  opencv-python
6
  grad-cam