user-agent commited on
Commit
71a0135
·
verified ·
1 Parent(s): 1b19ee1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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
- return "\n".join([f"{tag}: {score:.2f}" for tag, score in tags]), url
 
 
 
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,