Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -56,7 +56,10 @@ def gradio_predict(url, threshold):
|
|
| 56 |
tags, error = predict_tags(url, threshold)
|
| 57 |
if error:
|
| 58 |
return error, None
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
demo = gr.Interface(
|
| 62 |
fn=gradio_predict,
|
|
|
|
| 56 |
tags, error = predict_tags(url, threshold)
|
| 57 |
if error:
|
| 58 |
return error, None
|
| 59 |
+
# Return tags, and the image as a PIL object
|
| 60 |
+
image = load_image_from_url(url)
|
| 61 |
+
return "\n".join([f"{tag}: {score:.2f}" for tag, score in tags]), image
|
| 62 |
+
|
| 63 |
|
| 64 |
demo = gr.Interface(
|
| 65 |
fn=gradio_predict,
|