RitaParadaRamos commited on
Commit
a1eae7e
Β·
1 Parent(s): 05f63e3

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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="Retrieved captions and generated caption...", lines=4)
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(