Spaces:
Sleeping
Sleeping
Aar贸n Espasand铆n
commited on
Commit
路
3674354
1
Parent(s):
a4b2962
Changes related to Gradio update
Browse files- app.py +7 -6
- 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.
|
| 93 |
-
"
|
| 94 |
],
|
| 95 |
outputs=[
|
| 96 |
-
gr.
|
| 97 |
-
"
|
| 98 |
-
gr.
|
| 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
|
| 2 |
Pillow
|
| 3 |
-
facenet-pytorch
|
| 4 |
-
torch
|
| 5 |
opencv-python
|
| 6 |
grad-cam
|
|
|
|
| 1 |
+
gradio
|
| 2 |
Pillow
|
| 3 |
+
facenet-pytorch
|
| 4 |
+
torch
|
| 5 |
opencv-python
|
| 6 |
grad-cam
|