Spaces:
Sleeping
Sleeping
umyuu
commited on
Commit
·
e93672e
1
Parent(s):
4463b66
gr.Tab使用時のレイアウトの回り込みを修正しました。
Browse files
app.py
CHANGED
|
@@ -101,13 +101,10 @@ def gallery_selected(_, evt: gr.SelectData):
|
|
| 101 |
args = parse_args()
|
| 102 |
"""
|
| 103 |
アプリの画面を作成し、Gradioサービスを起動します。
|
| 104 |
-
analytics_enabled=False
|
| 105 |
-
https://github.com/gradio-app/gradio/issues/4226
|
| 106 |
ホットリロード対応として、topレベルのインデントに。
|
| 107 |
https://www.gradio.app/guides/developing-faster-with-reload-mode
|
| 108 |
"""
|
| 109 |
with gr.Blocks(
|
| 110 |
-
analytics_enabled=False,
|
| 111 |
title=f"{PROGRAM_NAME} {get_package_version()}",
|
| 112 |
head="""
|
| 113 |
<meta name="format-detection" content="telephone=no">
|
|
@@ -119,6 +116,7 @@ with gr.Blocks(
|
|
| 119 |
# Saliency Map demo.
|
| 120 |
画像における注目すべき領域を可視化する「顕著性マップ」を表示するデモアプリです。
|
| 121 |
""")
|
|
|
|
| 122 |
with gr.Accordion("取り扱い説明書", open=False):
|
| 123 |
gr.Markdown("""
|
| 124 |
## 顕著性マップとは
|
|
@@ -147,28 +145,21 @@ with gr.Blocks(
|
|
| 147 |
For instance, if eyes are focal points, focus enhancements there.
|
| 148 |
Thank you for your interest!
|
| 149 |
""")
|
|
|
|
| 150 |
algorithm_type = gr.Radio(
|
| 151 |
["SpectralResidual", "FineGrained"],
|
| 152 |
label="Saliency",
|
| 153 |
value="SpectralResidual",
|
| 154 |
interactive=True
|
| 155 |
)
|
| 156 |
-
|
| 157 |
submit_button = gr.Button("submit", variant="primary")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
|
| 159 |
-
with gr.Row():
|
| 160 |
-
with gr.Tab("input", id="input"):
|
| 161 |
-
image_input = gr.Image(sources=["upload", "clipboard"], interactive=True)
|
| 162 |
-
with gr.Tab("overlay(JET)"):
|
| 163 |
-
image_overlay_jet = gr.Image(interactive=False)
|
| 164 |
-
# tab_jet.select(jet_tab_selected,
|
| 165 |
-
# inputs=[image_input],
|
| 166 |
-
# outputs=image_overlay_jet)
|
| 167 |
-
with gr.Tab("overlay(HOT)"):
|
| 168 |
-
image_overlay_hot = gr.Image(interactive=False)
|
| 169 |
-
# tab_hot.select(hot_tab_selected,
|
| 170 |
-
# inputs=[image_input],
|
| 171 |
-
# outputs=image_overlay_hot, api_name=False)
|
| 172 |
#
|
| 173 |
with gr.Accordion("Sample Image Gallery", open=False):
|
| 174 |
gr.Markdown("""
|
|
|
|
| 101 |
args = parse_args()
|
| 102 |
"""
|
| 103 |
アプリの画面を作成し、Gradioサービスを起動します。
|
|
|
|
|
|
|
| 104 |
ホットリロード対応として、topレベルのインデントに。
|
| 105 |
https://www.gradio.app/guides/developing-faster-with-reload-mode
|
| 106 |
"""
|
| 107 |
with gr.Blocks(
|
|
|
|
| 108 |
title=f"{PROGRAM_NAME} {get_package_version()}",
|
| 109 |
head="""
|
| 110 |
<meta name="format-detection" content="telephone=no">
|
|
|
|
| 116 |
# Saliency Map demo.
|
| 117 |
画像における注目すべき領域を可視化する「顕著性マップ」を表示するデモアプリです。
|
| 118 |
""")
|
| 119 |
+
|
| 120 |
with gr.Accordion("取り扱い説明書", open=False):
|
| 121 |
gr.Markdown("""
|
| 122 |
## 顕著性マップとは
|
|
|
|
| 145 |
For instance, if eyes are focal points, focus enhancements there.
|
| 146 |
Thank you for your interest!
|
| 147 |
""")
|
| 148 |
+
|
| 149 |
algorithm_type = gr.Radio(
|
| 150 |
["SpectralResidual", "FineGrained"],
|
| 151 |
label="Saliency",
|
| 152 |
value="SpectralResidual",
|
| 153 |
interactive=True
|
| 154 |
)
|
|
|
|
| 155 |
submit_button = gr.Button("submit", variant="primary")
|
| 156 |
+
with gr.Tab("input"):
|
| 157 |
+
image_input = gr.Image(label="input", show_label=True, sources=["upload", "clipboard"])
|
| 158 |
+
with gr.Tab("overlay(JET)"):
|
| 159 |
+
image_overlay_jet = gr.Image(label="jet", show_label=True, interactive=False)
|
| 160 |
+
with gr.Tab("overlay(HOT)"):
|
| 161 |
+
image_overlay_hot = gr.Image(label="hot", show_label=True, interactive=False)
|
| 162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
#
|
| 164 |
with gr.Accordion("Sample Image Gallery", open=False):
|
| 165 |
gr.Markdown("""
|