Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,6 +32,8 @@ def classify_image(image_file):
|
|
| 32 |
|
| 33 |
return output_image, f"Predicted class: {label} (confidence: {confidence:.2f})"
|
| 34 |
|
|
|
|
|
|
|
| 35 |
iface = gr.Interface(
|
| 36 |
fn=classify_image,
|
| 37 |
inputs=gr.inputs.Image(type="filepath", label="Upload an image"),
|
|
@@ -40,5 +42,4 @@ iface = gr.Interface(
|
|
| 40 |
description="Classify images using a pre-trained ViT model",
|
| 41 |
)
|
| 42 |
|
| 43 |
-
# Launch the Gradio app
|
| 44 |
iface.launch()
|
|
|
|
| 32 |
|
| 33 |
return output_image, f"Predicted class: {label} (confidence: {confidence:.2f})"
|
| 34 |
|
| 35 |
+
from gradio import gradio as gr
|
| 36 |
+
|
| 37 |
iface = gr.Interface(
|
| 38 |
fn=classify_image,
|
| 39 |
inputs=gr.inputs.Image(type="filepath", label="Upload an image"),
|
|
|
|
| 42 |
description="Classify images using a pre-trained ViT model",
|
| 43 |
)
|
| 44 |
|
|
|
|
| 45 |
iface.launch()
|