osimeoni commited on
Commit
3e36141
·
1 Parent(s): 1d605a5
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -17,8 +17,8 @@ NORMALIZE = T.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225))
17
  CACHE = True
18
 
19
  def blend_images(bg, fg, alpha=0.5):
20
- fg = fg.convert('RGBA')
21
  bg = bg.convert('RGBA')
 
22
  blended = Image.blend(bg, fg, alpha=alpha)
23
 
24
  return blended
@@ -67,7 +67,7 @@ def predict(img_input):
67
  (sigmoid(preds_up.detach()) > 0.5).squeeze(0).float()
68
  )
69
 
70
- return blend_images(img_pil, preds_up)
71
 
72
 
73
  title = 'FOUND'
 
17
  CACHE = True
18
 
19
  def blend_images(bg, fg, alpha=0.5):
 
20
  bg = bg.convert('RGBA')
21
+ fg = fg.convert('RGBA')
22
  blended = Image.blend(bg, fg, alpha=alpha)
23
 
24
  return blended
 
67
  (sigmoid(preds_up.detach()) > 0.5).squeeze(0).float()
68
  )
69
 
70
+ return T.ToPILImage()(blend_images(img_pil, preds_up))
71
 
72
 
73
  title = 'FOUND'