svjack commited on
Commit
bb1d5ab
1 Parent(s): 6859b03

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -39,7 +39,11 @@ example_sample = [
39
 
40
  from PIL import Image
41
  def pred_func(image, prompt):
42
- out = single_pred_features(image)
 
 
 
 
43
  if type(out) == type({}):
44
  #return out["spiga_seg"]
45
  control_image = out["spiga_seg"]
@@ -59,11 +63,10 @@ def pred_func(image, prompt):
59
  return control_image ,image
60
 
61
 
62
- demo=gr.Interface(fn=pred_func, inputs=['image','text'],
63
  outputs=[gr.Image(label='output').style(height=512),
64
  gr.Image(label='output').style(height=512)],
65
  examples=example_sample if example_sample else None,
66
  cache_examples = False
67
  )
68
- demo.launch(share=False)
69
-
 
39
 
40
  from PIL import Image
41
  def pred_func(image, prompt):
42
+ #out = single_pred_features(image)
43
+ features ,face_features = single_pred_features(image)
44
+ req_img = produce_center_crop_image(features ,face_features)
45
+ out = {}
46
+ out["spiga_seg"] = req_img
47
  if type(out) == type({}):
48
  #return out["spiga_seg"]
49
  control_image = out["spiga_seg"]
 
63
  return control_image ,image
64
 
65
 
66
+ gr=gr.Interface(fn=pred_func, inputs=['image','text'],
67
  outputs=[gr.Image(label='output').style(height=512),
68
  gr.Image(label='output').style(height=512)],
69
  examples=example_sample if example_sample else None,
70
  cache_examples = False
71
  )
72
+ gr.launch(share=False)