Joseph Catrambone commited on
Commit
bc6c687
1 Parent(s): 2a6b1af

Fix min_confidence not getting passed to process. Add missing requirements.

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. requirements.txt +11 -4
app.py CHANGED
@@ -21,7 +21,7 @@ model = model.cuda()
21
  ddim_sampler = DDIMSampler(model) # ControlNet _only_ works with DDIM.
22
 
23
 
24
- def process(input_image: Image.Image, prompt, a_prompt, n_prompt, max_faces, min_confidence, num_samples, ddim_steps, guess_mode, strength, scale, seed, eta):
25
  with torch.no_grad():
26
  empty = generate_annotation(input_image, max_faces, min_confidence)
27
  visualization = Image.fromarray(empty) # Save to help debug.
@@ -98,7 +98,7 @@ with block:
98
  value='longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality')
99
  with gr.Column():
100
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2, height='auto')
101
- ips = [input_image, prompt, a_prompt, n_prompt, max_faces, num_samples, ddim_steps, guess_mode, strength, scale, seed, eta]
102
  run_button.click(fn=process, inputs=ips, outputs=[result_gallery])
103
 
104
 
 
21
  ddim_sampler = DDIMSampler(model) # ControlNet _only_ works with DDIM.
22
 
23
 
24
+ def process(input_image: Image.Image, prompt, a_prompt, n_prompt, max_faces: int, min_confidence: float, num_samples, ddim_steps, guess_mode, strength, scale, seed: int, eta):
25
  with torch.no_grad():
26
  empty = generate_annotation(input_image, max_faces, min_confidence)
27
  visualization = Image.fromarray(empty) # Save to help debug.
 
98
  value='longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality')
99
  with gr.Column():
100
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2, height='auto')
101
+ ips = [input_image, prompt, a_prompt, n_prompt, max_faces, min_confidence, num_samples, ddim_steps, guess_mode, strength, scale, seed, eta]
102
  run_button.click(fn=process, inputs=ips, outputs=[result_gallery])
103
 
104
 
requirements.txt CHANGED
@@ -1,6 +1,13 @@
 
 
1
  huggingface_hub==0.13.3
2
- mediapipe
3
  numpy
4
- pillow
5
- torch
6
- tqdm
 
 
 
 
 
 
1
+ einops
2
+ gradio
3
  huggingface_hub==0.13.3
4
+ mediapipe==0.9.1.0
5
  numpy
6
+ omegaconf
7
+ Pillow==9.4.0
8
+ pytorch-lightning==1.9.3
9
+ timm
10
+ transformers==4.26.1
11
+ torch==1.13.1
12
+ torchvision==0.14.1
13
+ tqdm==4.64.1