Spaces:
Runtime error
Runtime error
added another gradio output
Browse files- app.py +1 -1
- image_posterior.py +2 -2
app.py
CHANGED
@@ -86,7 +86,7 @@ if __name__ == "__main__":
|
|
86 |
# gradio's image inputs look like this: <PIL.Image.Image image mode=RGB size=305x266 at 0x7F3D01C91FA0>
|
87 |
# need to learn how to handle image inputs, or deal with file inputs or just file path strings
|
88 |
inp = gr.inputs.Textbox(lines=1, placeholder="Select an example from below", default="", label="Input Image Path", optional=False)
|
89 |
-
out = gr.outputs.HTML(label="Output GIF")
|
90 |
|
91 |
iface = gr.Interface(
|
92 |
segmentation_generation,
|
|
|
86 |
# gradio's image inputs look like this: <PIL.Image.Image image mode=RGB size=305x266 at 0x7F3D01C91FA0>
|
87 |
# need to learn how to handle image inputs, or deal with file inputs or just file path strings
|
88 |
inp = gr.inputs.Textbox(lines=1, placeholder="Select an example from below", default="", label="Input Image Path", optional=False)
|
89 |
+
out = [gr.outputs.HTML(label="Output GIF"), 'text']
|
90 |
|
91 |
iface = gr.Interface(
|
92 |
segmentation_generation,
|
image_posterior.py
CHANGED
@@ -93,10 +93,10 @@ def create_gif(explanation_blr, img_name, segments, image, prediction, n_images=
|
|
93 |
html = (
|
94 |
"<div>"
|
95 |
+ f"<img src='file/{img_name}_explanation.gif' alt='explanation gif'/>"
|
96 |
-
+ f"<p>Prediction is {prediction}: {labels_dict[prediction]}</p>"
|
97 |
+ "</div>"
|
98 |
)
|
99 |
-
|
|
|
100 |
|
101 |
|
102 |
|
|
|
93 |
html = (
|
94 |
"<div>"
|
95 |
+ f"<img src='file/{img_name}_explanation.gif' alt='explanation gif'/>"
|
|
|
96 |
+ "</div>"
|
97 |
)
|
98 |
+
|
99 |
+
return html, f"Predction was {prediction}: {labels_dict[prediction]}"
|
100 |
|
101 |
|
102 |
|