Haiyu Wu commited on
Commit
5ba379a
·
1 Parent(s): 94d3e3e
Files changed (1) hide show
  1. app.py +15 -17
app.py CHANGED
@@ -25,11 +25,11 @@ def clear_generation_time():
25
 
26
 
27
  def generating():
28
- return "Generating images..."
29
 
30
 
31
  def done():
32
- return "Done!"
33
 
34
 
35
  def sample_nearby_vectors(base_vector, epsilons=[0.3, 0.5, 0.7], percentages=[0.4, 0.4, 0.2]):
@@ -145,17 +145,17 @@ def select_image(value, images):
145
  index = int(value / 2)
146
  return images[index]
147
 
148
- def toggle_inputs(use_pose):
149
  return [
150
- gr.update(visible=use_pose, interactive=use_pose), # sigma
151
- gr.update(interactive=not use_pose), # num1
152
- gr.update(interactive=not use_pose), # num2
153
- gr.update(interactive=not use_pose), # num3
154
- gr.update(interactive=not use_pose), # num4
155
- gr.update(interactive=not use_pose), # num5
156
- gr.update(interactive=not use_pose), # num6
157
- gr.update(interactive=not use_pose), # num7
158
- gr.update(interactive=not use_pose), # num8
159
  ]
160
 
161
 
@@ -209,9 +209,7 @@ def main():
209
  gr.Markdown("""
210
  ## Usage tips of Vec2Face
211
  - Directly clicking "Submit" button will give you results from a randomly sampled vector.
212
- - If you want to modify more dimensions, please write your own code. Code snippets in [Vec2Face repo](https://github.com/HaiyuWu/vec2face) might be helpful.
213
- - If you want to create extreme pose image (e.g., >70), please do not set image quality larger than 27.
214
- - <span style="color: red;">!</span> <span style="color: red;">!</span> <span style="color: red;">!</span> **Due to the limitation of SixDRepNet (pose estimator), pose editing results might be corrupted/incorrect. For better performance, you can integrade other pose estimators.** <span style="color: red;">!</span> <span style="color: red;">!</span> <span style="color: red;">!</span>
215
  - For better experience, we suggest you to run code on a GPU machine.
216
  """)
217
 
@@ -219,11 +217,11 @@ def main():
219
  gallery = gr.Image(label="Generated Image")
220
  generation_time = gr.Textbox(label="Generation Status")
221
  incremental_value_slider = gr.Slider(
222
- label="Result of dimension modification or results of pose images",
223
  minimum=0, maximum=4, step=2, value=0
224
  )
225
  gr.Markdown("""
226
- - These values are added to the dimensions (before normalization), **please ignore it if pose editing is on**.
227
  """)
228
 
229
  random_perturbation.change(
 
25
 
26
 
27
  def generating():
28
+ return "**Generating images...**"
29
 
30
 
31
  def done():
32
+ return "**Done!**"
33
 
34
 
35
  def sample_nearby_vectors(base_vector, epsilons=[0.3, 0.5, 0.7], percentages=[0.4, 0.4, 0.2]):
 
145
  index = int(value / 2)
146
  return images[index]
147
 
148
+ def toggle_inputs(random_perturbation):
149
  return [
150
+ gr.update(visible=random_perturbation, interactive=random_perturbation), # sigma
151
+ gr.update(interactive=not random_perturbation), # num1
152
+ gr.update(interactive=not random_perturbation), # num2
153
+ gr.update(interactive=not random_perturbation), # num3
154
+ gr.update(interactive=not random_perturbation), # num4
155
+ gr.update(interactive=not random_perturbation), # num5
156
+ gr.update(interactive=not random_perturbation), # num6
157
+ gr.update(interactive=not random_perturbation), # num7
158
+ gr.update(interactive=not random_perturbation), # num8
159
  ]
160
 
161
 
 
209
  gr.Markdown("""
210
  ## Usage tips of Vec2Face
211
  - Directly clicking "Submit" button will give you results from a randomly sampled vector.
212
+ - If you want to modify more dimensions or change attributes, Code snippets in [Vec2Face repo](https://github.com/HaiyuWu/vec2face) might be helpful.
 
 
213
  - For better experience, we suggest you to run code on a GPU machine.
214
  """)
215
 
 
217
  gallery = gr.Image(label="Generated Image")
218
  generation_time = gr.Textbox(label="Generation Status")
219
  incremental_value_slider = gr.Slider(
220
+ label="Result of dimension modification or results of random perturbation",
221
  minimum=0, maximum=4, step=2, value=0
222
  )
223
  gr.Markdown("""
224
+ - These values are added to the dimensions (before normalization), **please ignore it if random perturbation is on**.
225
  """)
226
 
227
  random_perturbation.change(