Update app.py
Browse files
app.py
CHANGED
@@ -50,12 +50,6 @@ class Classifier:
|
|
50 |
logits = self.model(input_tensor)
|
51 |
probs = F.softmax(logits[:, :7], dim=1).cpu()
|
52 |
|
53 |
-
# probs = pd.DataFrame(
|
54 |
-
# {
|
55 |
-
# "class": self.LABELS,
|
56 |
-
# "probs": probs[0] * 100,
|
57 |
-
# }
|
58 |
-
# )
|
59 |
return draw_bar_chart(
|
60 |
{
|
61 |
"class": self.LABELS,
|
@@ -117,28 +111,28 @@ def get_layout():
|
|
117 |
font-size: 14px;
|
118 |
}
|
119 |
"""
|
120 |
-
theme = gr.themes.Base(
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
).set(
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
)
|
130 |
with gr.Blocks(css=css, theme='gstaff/xkcd') as demo:
|
131 |
with gr.Column():
|
132 |
-
gr.HTML(
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
)
|
142 |
|
143 |
with gr.Row(equal_height=True):
|
144 |
image_input = gr.Image(label="上傳影像", type="pil")
|
@@ -151,9 +145,9 @@ def get_layout():
|
|
151 |
outputs=bar_chart,
|
152 |
)
|
153 |
|
154 |
-
gr.HTML(
|
155 |
-
|
156 |
-
)
|
157 |
|
158 |
return demo
|
159 |
|
|
|
50 |
logits = self.model(input_tensor)
|
51 |
probs = F.softmax(logits[:, :7], dim=1).cpu()
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
return draw_bar_chart(
|
54 |
{
|
55 |
"class": self.LABELS,
|
|
|
111 |
font-size: 14px;
|
112 |
}
|
113 |
"""
|
114 |
+
# theme = gr.themes.Base(
|
115 |
+
# primary_hue="orange",
|
116 |
+
# secondary_hue="orange",
|
117 |
+
# neutral_hue="gray",
|
118 |
+
# font=gr.themes.GoogleFont("Source Sans Pro"),
|
119 |
+
# ).set(
|
120 |
+
# background_fill_primary="*neutral_950", # 主背景色(深黑)
|
121 |
+
# button_primary_background_fill="*primary_500", # 按鈕顏色(橘色)
|
122 |
+
# body_text_color="*neutral_200", # 文字顏色(淺色)
|
123 |
+
# )
|
124 |
with gr.Blocks(css=css, 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")
|
|
|
145 |
outputs=bar_chart,
|
146 |
)
|
147 |
|
148 |
+
# gr.HTML(
|
149 |
+
# '<div class="footer">© 2024 LCL 版權所有<br>開發者:何立智、楊哲睿</div>',
|
150 |
+
# )
|
151 |
|
152 |
return demo
|
153 |
|