Fawaz commited on
Commit
4b77f1f
·
1 Parent(s): 1401821

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -192,7 +192,7 @@ def inference(raw_image, question):
192
  mask = cv2.resize(mask / mask.max(), oimg.size)[..., np.newaxis]
193
  attention_map = (mask * oimg).astype("uint8")
194
  splitted_seq = seq.split("because")
195
- return splitted_seq[0].strip(), "because " + " ".join(splitted_seq[-1].strip()), Image.fromarray(attention_map)
196
 
197
  inputs = [gr.inputs.Image(type='pil', label="Load the image of your interest"), gr.inputs.Textbox(label="Ask a question on this image")]
198
  outputs = [gr.outputs.Textbox(label="Answer"), gr.outputs.Textbox(label="Textual Explanation"), gr.outputs.Image(type='pil', label="Visual Explanation")]
 
192
  mask = cv2.resize(mask / mask.max(), oimg.size)[..., np.newaxis]
193
  attention_map = (mask * oimg).astype("uint8")
194
  splitted_seq = seq.split("because")
195
+ return splitted_seq[0].strip(), "because " + splitted_seq[-1].strip(), Image.fromarray(attention_map)
196
 
197
  inputs = [gr.inputs.Image(type='pil', label="Load the image of your interest"), gr.inputs.Textbox(label="Ask a question on this image")]
198
  outputs = [gr.outputs.Textbox(label="Answer"), gr.outputs.Textbox(label="Textual Explanation"), gr.outputs.Image(type='pil', label="Visual Explanation")]