Hev832 commited on
Commit
d266e0b
1 Parent(s): 146d122

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
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
- # Gradio interface
33
- iface = 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()
 
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()