LPX commited on
Commit
a8148b4
ยท
1 Parent(s): fc5a47a

๐Ÿ› fix(gui): make post processed images gallery fit correctly

Browse files

- add height, object_fit, and elem_id to forensics_gallery to enhance image fitting

๐Ÿ› ๏ธ chore(gui): improve ui with additional sidebar

- add a sidebar Markdown component to improve user interface

Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -269,7 +269,7 @@ with gr.Blocks() as iface:
269
  with gr.Column(scale=2):
270
  # Custom HTML component to display results in 5 columns
271
  results_html = gr.HTML(label="Model Predictions")
272
- forensics_gallery = gr.Gallery(label="Post Processed Images", visible=True, columns=[5], rows=[1], container=False)
273
 
274
  outputs = [image_output, forensics_gallery, results_html]
275
 
@@ -305,6 +305,8 @@ with gr.Blocks() as iface:
305
  with gr.Tab("Another Interface"):
306
  # Add components for the second interface here
307
  gr.Markdown("# Another Interface")
 
 
308
  # Example: Add a simple text input and output
309
  text_input = gr.Textbox(label="Enter Text")
310
  text_output = gr.Textbox(label="Processed Text")
 
269
  with gr.Column(scale=2):
270
  # Custom HTML component to display results in 5 columns
271
  results_html = gr.HTML(label="Model Predictions")
272
+ forensics_gallery = gr.Gallery(label="Post Processed Images", visible=True, columns=[5], rows=[1], container=False, height="auto", object_fit="contain", elem_id="post-gallery")
273
 
274
  outputs = [image_output, forensics_gallery, results_html]
275
 
 
305
  with gr.Tab("Another Interface"):
306
  # Add components for the second interface here
307
  gr.Markdown("# Another Interface")
308
+ with gr.Sidebar():
309
+ gr.Markdown("# Another Interface")
310
  # Example: Add a simple text input and output
311
  text_input = gr.Textbox(label="Enter Text")
312
  text_output = gr.Textbox(label="Processed Text")