Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 " +
|
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")]
|