Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -91,10 +91,8 @@ with gr.Blocks() as demo:
|
|
91 |
query_button = gr.Button("查詢")
|
92 |
|
93 |
with gr.Row():
|
94 |
-
|
95 |
-
|
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
|
121 |
-
|
122 |
-
#image
|
123 |
-
max-width:
|
124 |
-
max-height:
|
|
|
125 |
}
|
126 |
-
"""
|
127 |
|
128 |
# Launch the Gradio app
|
129 |
-
demo.launch(
|
|
|
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()
|