Update app.py
Browse files
app.py
CHANGED
|
@@ -375,11 +375,29 @@ def process_and_analyze(image):
|
|
| 375 |
print(detailed_error) # Debug print
|
| 376 |
return None, f"Error processing image: {error_msg}"
|
| 377 |
|
| 378 |
-
|
| 379 |
# Create Gradio interface
|
| 380 |
def create_interface():
|
| 381 |
with gr.Blocks() as demo:
|
| 382 |
-
gr.Markdown("# Image Surprise
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 383 |
|
| 384 |
with gr.Row():
|
| 385 |
with gr.Column():
|
|
@@ -399,6 +417,8 @@ def create_interface():
|
|
| 399 |
return demo
|
| 400 |
|
| 401 |
|
|
|
|
|
|
|
| 402 |
if __name__ == "__main__":
|
| 403 |
demo = create_interface()
|
| 404 |
demo.launch()
|
|
|
|
| 375 |
print(detailed_error) # Debug print
|
| 376 |
return None, f"Error processing image: {error_msg}"
|
| 377 |
|
|
|
|
| 378 |
# Create Gradio interface
|
| 379 |
def create_interface():
|
| 380 |
with gr.Blocks() as demo:
|
| 381 |
+
gr.Markdown("# Image Anomaly-Surprise Detection")
|
| 382 |
+
gr.Markdown(
|
| 383 |
+
"This project offers a tool that identifies surprising elements in images, "
|
| 384 |
+
"pinpointing what violates our expectations. It analyzes images for unexpected objects, "
|
| 385 |
+
"locations, social scenarios, settings, and roles."
|
| 386 |
+
)
|
| 387 |
+
|
| 388 |
+
# Add example images as a table
|
| 389 |
+
gr.HTML(
|
| 390 |
+
"""
|
| 391 |
+
<table>
|
| 392 |
+
<tr>
|
| 393 |
+
<td><img src="appendix/gradio_example.png" width="250" alt="Image 1"></td>
|
| 394 |
+
<td><img src="appendix/gradio_example2.png" width="250" alt="Image 2"></td>
|
| 395 |
+
<td><img src="appendix/gradio_example3.png" width="250" alt="Image 3"></td>
|
| 396 |
+
<td><img src="appendix/gradio_example4.png" width="250" alt="Image 4"></td>
|
| 397 |
+
</tr>
|
| 398 |
+
</table>
|
| 399 |
+
"""
|
| 400 |
+
)
|
| 401 |
|
| 402 |
with gr.Row():
|
| 403 |
with gr.Column():
|
|
|
|
| 417 |
return demo
|
| 418 |
|
| 419 |
|
| 420 |
+
|
| 421 |
+
|
| 422 |
if __name__ == "__main__":
|
| 423 |
demo = create_interface()
|
| 424 |
demo.launch()
|