ใ†ใฟใ‚… commited on
Commit
1de07f5
ยท
unverified ยท
2 Parent(s): c2477d1 e93672e

Merge pull request #15 from umyuu/feaure/0.0.11

Browse files
Files changed (4) hide show
  1. README.md +1 -1
  2. app.py +8 -17
  3. requirements.txt +4 -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
- ![Python version](https://img.shields.io/badge/python-3.9+-important)
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
  ## ๐Ÿ“ ๆฆ‚่ฆ
 
8
  pinned: false
9
  ---
10
  # ๐Ÿ“– SaliencyMap โ€” in Python
11
+ ![Python version](https://img.shields.io/badge/python-3.10+-important)
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==4.36.0
2
- gradio_client==1.0.1
3
- opencv-python==4.10.0.82
4
- opencv-contrib-python==4.10.0.82
 
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.10'
12
 
13
 
14
  @dataclass
 
8
  """
9
  ใƒใƒผใ‚ธใƒงใƒณๆƒ…ๅ ฑใ‚’ๅ–ๅพ—ใ—ใพใ™ใ€‚
10
  """
11
+ return '0.0.11'
12
 
13
 
14
  @dataclass