nekoshadow commited on
Commit
3a48cd6
1 Parent(s): fe0626e

Fix slider issue

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. requirements.txt +2 -1
app.py CHANGED
@@ -214,8 +214,6 @@ def run_demo():
214
  azimuth = gr.Slider(0, 360, 90, step=22.5, label='Target azimuth', interactive=True)
215
  crop_size = gr.Slider(120, 240, 200, step=10, label='Crop size', interactive=True)
216
 
217
- target_index = round(azimuth % 360 / 22.5)
218
-
219
  # Compose demo layout & data flow.
220
  with gr.Blocks(title=_TITLE, css="hf_demo/style.css") as demo:
221
  with gr.Row():
@@ -279,6 +277,8 @@ def run_demo():
279
  # crop_btn.click(fn=resize_inputs, inputs=[sam_block, crop_size], outputs=[input_block], queue=False)\
280
  # .success(fn=partial(update_guide, _USER_GUIDE2), outputs=[guide_text], queue=False)
281
 
 
 
282
  run_btn.click(partial(generate, pipe), inputs=[input_block, target_index], outputs=[output_block], queue=True)\
283
  .success(fn=partial(update_guide, _USER_GUIDE3), outputs=[guide_text], queue=False)
284
 
 
214
  azimuth = gr.Slider(0, 360, 90, step=22.5, label='Target azimuth', interactive=True)
215
  crop_size = gr.Slider(120, 240, 200, step=10, label='Crop size', interactive=True)
216
 
 
 
217
  # Compose demo layout & data flow.
218
  with gr.Blocks(title=_TITLE, css="hf_demo/style.css") as demo:
219
  with gr.Row():
 
277
  # crop_btn.click(fn=resize_inputs, inputs=[sam_block, crop_size], outputs=[input_block], queue=False)\
278
  # .success(fn=partial(update_guide, _USER_GUIDE2), outputs=[guide_text], queue=False)
279
 
280
+ azimuth.render()
281
+ target_index = round(azimuth % 360 / 22.5)
282
  run_btn.click(partial(generate, pipe), inputs=[input_block, target_index], outputs=[output_block], queue=True)\
283
  .success(fn=partial(update_guide, _USER_GUIDE3), outputs=[guide_text], queue=False)
284
 
requirements.txt CHANGED
@@ -21,4 +21,5 @@ nerfacc
21
  imageio-ffmpeg==0.4.7
22
  fire
23
  segment_anything
24
- git+https://github.com/openai/CLIP.git
 
 
21
  imageio-ffmpeg==0.4.7
22
  fire
23
  segment_anything
24
+ git+https://github.com/openai/CLIP.git
25
+ accelerate