Update app.py
Browse files
app.py
CHANGED
|
@@ -127,32 +127,33 @@ def get_layout():
|
|
| 127 |
button_primary_background_fill="*primary_500", # 按鈕顏色(橘色)
|
| 128 |
body_text_color="*neutral_200", # 文字顏色(淺色)
|
| 129 |
)
|
| 130 |
-
with gr.Blocks(css=css, theme=
|
| 131 |
-
gr.
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
|
|
|
| 156 |
|
| 157 |
return demo
|
| 158 |
|
|
|
|
| 127 |
button_primary_background_fill="*primary_500", # 按鈕顏色(橘色)
|
| 128 |
body_text_color="*neutral_200", # 文字顏色(淺色)
|
| 129 |
)
|
| 130 |
+
with gr.Blocks(css=css, theme='gstaff/xkcd') as demo:
|
| 131 |
+
with gr.Column():
|
| 132 |
+
gr.HTML(
|
| 133 |
+
value=(
|
| 134 |
+
'<div class="main-title">Litton7景觀分類模型</div>'
|
| 135 |
+
'<div class="reference">引用資料:'
|
| 136 |
+
'<a href="https://www.airitilibrary.com/Article/Detail/10125434-N202406210003-00003" target="_blank">'
|
| 137 |
+
"何立智、李沁築、邱浩修(2024)。Litton7:Litton視覺景觀分類深度學習模型。戶外遊憩研究,37(2)"
|
| 138 |
+
"</a>"
|
| 139 |
+
"</div>"
|
| 140 |
+
),
|
| 141 |
+
)
|
| 142 |
+
|
| 143 |
+
with gr.Row().style(equal_height=True):
|
| 144 |
+
image_input = gr.Image(label="上傳影像", type="pil")
|
| 145 |
+
bar_chart = gr.Plot(label="分類結果")
|
| 146 |
+
start_button = gr.Button("開始分類", variant="primary")
|
| 147 |
+
|
| 148 |
+
start_button.click(
|
| 149 |
+
fn=Classifier().predict,
|
| 150 |
+
inputs=image_input,
|
| 151 |
+
outputs=bar_chart,
|
| 152 |
+
)
|
| 153 |
+
|
| 154 |
+
gr.HTML(
|
| 155 |
+
'<div class="footer">© 2024 LCL 版權所有<br>開發者:何立智、楊哲睿</div>',
|
| 156 |
+
)
|
| 157 |
|
| 158 |
return demo
|
| 159 |
|