Spaces:
Sleeping
Sleeping
Merge pull request #15 from umyuu/feaure/0.0.11
Browse files- README.md +1 -1
- app.py +8 -17
- requirements.txt +4 -4
- src/utils.py +1 -1
README.md
CHANGED
@@ -8,7 +8,7 @@ colorTo: yellow
|
|
8 |
pinned: false
|
9 |
---
|
10 |
# ๐ SaliencyMap โ in Python
|
11 |
-

|
12 |
<a href="https://colab.research.google.com/github/umyuu/SaliencyMapDemo/blob/main/scripts/launch_app.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
|
13 |
|
14 |
## ๐ ๆฆ่ฆ
|
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("""
|
requirements.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
gradio==
|
2 |
-
gradio_client==1.0
|
3 |
-
opencv-python==4.10.0.
|
4 |
-
opencv-contrib-python==4.10.0.
|
|
|
1 |
+
gradio==5.0.1
|
2 |
+
gradio_client==1.4.0
|
3 |
+
opencv-python==4.10.0.84
|
4 |
+
opencv-contrib-python==4.10.0.84
|
src/utils.py
CHANGED
@@ -8,7 +8,7 @@ def get_package_version() -> str:
|
|
8 |
"""
|
9 |
ใใผใธใงใณๆ
ๅ ฑใๅๅพใใพใใ
|
10 |
"""
|
11 |
-
return '0.0.
|
12 |
|
13 |
|
14 |
@dataclass
|
|
|
8 |
"""
|
9 |
ใใผใธใงใณๆ
ๅ ฑใๅๅพใใพใใ
|
10 |
"""
|
11 |
+
return '0.0.11'
|
12 |
|
13 |
|
14 |
@dataclass
|