Lashtw commited on
Commit
fd319c3
·
verified ·
1 Parent(s): 44047d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -11
app.py CHANGED
@@ -91,10 +91,8 @@ with gr.Blocks() as demo:
91
  query_button = gr.Button("查詢")
92
 
93
  with gr.Row():
94
- with gr.Column():
95
- output_box = gr.Textbox(label="查詢結果", interactive=False)
96
- with gr.Column():
97
- image_output = gr.Image(label="嫌疑犯圖片", visible=True, elem_id="image-small")
98
 
99
  indirect_button = gr.Button("間接證據", visible=False)
100
  indirect_output = gr.Textbox(label="間接證據內容", interactive=False, visible=False)
@@ -117,13 +115,14 @@ with gr.Blocks() as demo:
117
  outputs=[input_box, indirect_button, indirect_output, output_box, image_output]
118
  )
119
 
120
- # Add custom CSS for image size
121
- css = """
122
- #image-small img {
123
- max-width: 150px;
124
- max-height: 150px;
 
125
  }
126
- """
127
 
128
  # Launch the Gradio app
129
- demo.launch(css=css)
 
91
  query_button = gr.Button("查詢")
92
 
93
  with gr.Row():
94
+ output_box = gr.Textbox(label="查詢結果", interactive=False)
95
+ image_output = gr.Image(label="嫌疑犯圖片", visible=True, elem_id="suspect-image")
 
 
96
 
97
  indirect_button = gr.Button("間接證據", visible=False)
98
  indirect_output = gr.Textbox(label="間接證據內容", interactive=False, visible=False)
 
115
  outputs=[input_box, indirect_button, indirect_output, output_box, image_output]
116
  )
117
 
118
+ # Add custom CSS to adjust image size
119
+ demo.add_css("""
120
+ #suspect-image img {
121
+ max-width: 100px;
122
+ max-height: 100px;
123
+ object-fit: contain;
124
  }
125
+ """)
126
 
127
  # Launch the Gradio app
128
+ demo.launch()