Update app.py
Browse files
app.py
CHANGED
@@ -10,13 +10,13 @@ classifier = VisionClassifierInference(
|
|
10 |
)
|
11 |
|
12 |
# Define a Gradio interface
|
13 |
-
def classify_image(
|
14 |
-
label = classifier.predict(img_path=
|
15 |
return f"Predicted class: {label}"
|
16 |
|
17 |
iface = gr.Interface(
|
18 |
fn=classify_image,
|
19 |
-
inputs=gr.inputs.Image(type="
|
20 |
outputs="text",
|
21 |
title="Image Classifier",
|
22 |
description="Classify images using a pre-trained ViT model",
|
|
|
10 |
)
|
11 |
|
12 |
# Define a Gradio interface
|
13 |
+
def classify_image(image_file):
|
14 |
+
label = classifier.predict(img_path=image_file.name)
|
15 |
return f"Predicted class: {label}"
|
16 |
|
17 |
iface = gr.Interface(
|
18 |
fn=classify_image,
|
19 |
+
inputs=gr.inputs.Image(type="filepath", label="Upload an image"),
|
20 |
outputs="text",
|
21 |
title="Image Classifier",
|
22 |
description="Classify images using a pre-trained ViT model",
|