svjack commited on
Commit
4dee35d
1 Parent(s): 7d4ee5a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -43,13 +43,13 @@ def pred_func(image, prompt):
43
  if type(out) == type({}):
44
  #return out["spiga_seg"]
45
  control_image = out["spiga_seg"]
46
- if type(control_image) == type("") and os.path.exists(control_image):
47
- control_image = Image.open(control_image).convert("RGB")
48
  elif hasattr(image, "shape"):
49
- control_image = Image.fromarray(control_image).convert("RGB")
50
  else:
51
- control_image = control_image.convert("RGB")
52
- control_image = control_image.resize((512, 512))
53
 
54
  generator = torch.manual_seed(0)
55
  image = pipe(
 
43
  if type(out) == type({}):
44
  #return out["spiga_seg"]
45
  control_image = out["spiga_seg"]
46
+ if type(image) == type("") and os.path.exists(image):
47
+ image = Image.open(image).convert("RGB")
48
  elif hasattr(image, "shape"):
49
+ image = Image.fromarray(image).convert("RGB")
50
  else:
51
+ image = image.convert("RGB")
52
+ image = image.resize((512, 512))
53
 
54
  generator = torch.manual_seed(0)
55
  image = pipe(