Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,5 +8,11 @@ def classify(img):
|
|
8 |
predictions = detector(img, candidate_labels=["fox", "bear", "seagull", "owl"])
|
9 |
return predictions
|
10 |
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
iface.launch()
|
|
|
8 |
predictions = detector(img, candidate_labels=["fox", "bear", "seagull", "owl"])
|
9 |
return predictions
|
10 |
|
11 |
+
with gr.Blocks() as iface:
|
12 |
+
image = gr.Image(type="pil", label="Image")
|
13 |
+
candidates = gr.Textbox(label="Candidates")
|
14 |
+
predictions = gr.Textbox(label="Predictions")
|
15 |
+
btn = gr.Button("Classify")
|
16 |
+
bt.click(fn=classify, inputs=[image, candidates], outputs=predictions, api_name="classify")
|
17 |
+
|
18 |
iface.launch()
|