Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,17 +12,16 @@ def predict(image: Image.Image):
|
|
12 |
animation.visible = False # Hide the animation
|
13 |
return result, f"Confidence: {confidence:.2f}%"
|
14 |
|
15 |
-
theme = gr.themes.Soft()
|
16 |
|
17 |
-
with gr.Interface(theme=theme) as demo:
|
18 |
# Define the Gradio interface
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
26 |
|
27 |
# Launch the Gradio interface
|
28 |
if __name__ == "__main__":
|
|
|
12 |
animation.visible = False # Hide the animation
|
13 |
return result, f"Confidence: {confidence:.2f}%"
|
14 |
|
|
|
15 |
|
|
|
16 |
# Define the Gradio interface
|
17 |
+
gr.Interface(
|
18 |
+
fn=predict,
|
19 |
+
inputs=gr.Image(type="pil"),
|
20 |
+
outputs=[gr.Textbox(), gr.Textbox()],
|
21 |
+
title="Vision Transformer Model",
|
22 |
+
description="Upload an image to classify it using the Vision Transformer model.",
|
23 |
+
theme = gr.themes.Soft()
|
24 |
+
)
|
25 |
|
26 |
# Launch the Gradio interface
|
27 |
if __name__ == "__main__":
|