Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -90,8 +90,12 @@ with gr.Blocks() as demo:
|
|
90 |
input_box = gr.Textbox(label="請輸入蛛絲馬跡號碼", placeholder="例如: 11", lines=1)
|
91 |
query_button = gr.Button("查詢")
|
92 |
|
93 |
-
|
94 |
-
|
|
|
|
|
|
|
|
|
95 |
indirect_button = gr.Button("間接證據", visible=False)
|
96 |
indirect_output = gr.Textbox(label="間接證據內容", interactive=False, visible=False)
|
97 |
reset_button = gr.Button("重新查詢")
|
@@ -113,5 +117,13 @@ with gr.Blocks() as demo:
|
|
113 |
outputs=[input_box, indirect_button, indirect_output, output_box, image_output]
|
114 |
)
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
# Launch the Gradio app
|
117 |
-
demo.launch()
|
|
|
90 |
input_box = gr.Textbox(label="請輸入蛛絲馬跡號碼", placeholder="例如: 11", lines=1)
|
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)
|
101 |
reset_button = gr.Button("重新查詢")
|
|
|
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)
|