Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -29,15 +29,15 @@ def classify_image(img):
|
|
29 |
# Format the output
|
30 |
return {label: float(probability) for (_, label, probability) in decoded_predictions}
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
)
|
41 |
|
42 |
# Launch the interface
|
43 |
iface.launch()
|
|
|
29 |
# Format the output
|
30 |
return {label: float(probability) for (_, label, probability) in decoded_predictions}
|
31 |
|
32 |
+
with gr.Blocks(theme="Hev832/Applio") as iface:
|
33 |
+
gr.Interface(
|
34 |
+
fn=classify_image, # Function to call for predictions
|
35 |
+
inputs=gr.Image(type="pil"), # Input is an image
|
36 |
+
outputs=gr.Label(num_top_classes=3), # Output is a label with top 3 predictions
|
37 |
+
title="Contextual Image Classification",
|
38 |
+
description="Upload an image, and the model will classify it based on the context.",
|
39 |
+
#examples=[chameleon],
|
40 |
+
)
|
41 |
|
42 |
# Launch the interface
|
43 |
iface.launch()
|