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