Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,11 +4,11 @@ import numpy as np
|
|
4 |
# 模擬辨識按鈕的回傳邏輯
|
5 |
def fake_detect(image):
|
6 |
# 回傳原圖 + 提示字樣
|
7 |
-
return image, "
|
8 |
|
9 |
# 建立 Gradio 介面
|
10 |
with gr.Blocks() as demo:
|
11 |
-
gr.Markdown("## 🦺 Helmet
|
12 |
gr.Markdown("請上傳一張圖片,然後點擊「辨識」按鈕模擬結果展示")
|
13 |
|
14 |
with gr.Row():
|
@@ -17,8 +17,8 @@ with gr.Blocks() as demo:
|
|
17 |
detect_button = gr.Button("辨識")
|
18 |
|
19 |
with gr.Column():
|
20 |
-
image_output = gr.Image(type="numpy", label="
|
21 |
-
result_label = gr.Textbox(label="辨識摘要", placeholder="
|
22 |
|
23 |
detect_button.click(fn=fake_detect, inputs=image_input, outputs=[image_output, result_label])
|
24 |
|
|
|
4 |
# 模擬辨識按鈕的回傳邏輯
|
5 |
def fake_detect(image):
|
6 |
# 回傳原圖 + 提示字樣
|
7 |
+
return image, "(not)"
|
8 |
|
9 |
# 建立 Gradio 介面
|
10 |
with gr.Blocks() as demo:
|
11 |
+
gr.Markdown("## 🦺 Helmet ")
|
12 |
gr.Markdown("請上傳一張圖片,然後點擊「辨識」按鈕模擬結果展示")
|
13 |
|
14 |
with gr.Row():
|
|
|
17 |
detect_button = gr.Button("辨識")
|
18 |
|
19 |
with gr.Column():
|
20 |
+
image_output = gr.Image(type="numpy", label="推論結果")
|
21 |
+
result_label = gr.Textbox(label="辨識摘要", placeholder="結果")
|
22 |
|
23 |
detect_button.click(fn=fake_detect, inputs=image_input, outputs=[image_output, result_label])
|
24 |
|