Spaces:
Runtime error
Runtime error
Commit
·
a1eae7e
1
Parent(s):
05f63e3
Upload app.py
Browse files
app.py
CHANGED
|
@@ -88,13 +88,13 @@ def classify_image(image):
|
|
| 88 |
#inp = tf.keras.applications.mobilenet_v2.preprocess_input(inp)
|
| 89 |
#prediction = inception_net.predict(inp).flatten()
|
| 90 |
retrieved_caps="Retrieved captions: \n{}\n{}\n{}\n{}".format(*caps)
|
| 91 |
-
return retrieved_caps + "\n\n\n Generated caption:\n" + str(postprocess_preds(tokenizer.decode(pred[0]), tokenizer))
|
| 92 |
|
|
|
|
| 93 |
|
| 94 |
image = gr.Image(type="pil")
|
| 95 |
|
| 96 |
-
textbox = gr.Textbox(placeholder="
|
| 97 |
-
|
| 98 |
|
| 99 |
title = "SmallCap Demo"
|
| 100 |
gr.Interface(
|
|
|
|
| 88 |
#inp = tf.keras.applications.mobilenet_v2.preprocess_input(inp)
|
| 89 |
#prediction = inception_net.predict(inp).flatten()
|
| 90 |
retrieved_caps="Retrieved captions: \n{}\n{}\n{}\n{}".format(*caps)
|
| 91 |
+
#return retrieved_caps + "\n\n\n Generated caption:\n" + str(postprocess_preds(tokenizer.decode(pred[0]), tokenizer))
|
| 92 |
|
| 93 |
+
return str(postprocess_preds(tokenizer.decode(pred[0]), tokenizer)) + "\n\n\n"+ retrieved_caps
|
| 94 |
|
| 95 |
image = gr.Image(type="pil")
|
| 96 |
|
| 97 |
+
textbox = gr.Textbox(placeholder="Generated caption and retrieved captions...", lines=4)
|
|
|
|
| 98 |
|
| 99 |
title = "SmallCap Demo"
|
| 100 |
gr.Interface(
|