william1324 commited on
Commit
83acea6
·
verified ·
1 Parent(s): 5015978

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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 Detector Demo Interface")
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