djl234 commited on
Commit
1ea08ed
·
verified ·
1 Parent(s): 59f9e7b

Update app.py

Browse files

[fix] adjust portion

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -38,8 +38,8 @@ def generate_mask(img, coord):
38
  col=col/col.max()
39
  mask_torch=torch.from_numpy(mask).squeeze().unsqueeze(2).repeat(1,1,3)
40
  maks_torch=mask_torch/mask_torch.max()
41
- col[:,:,0]=0
42
- mix = (1-mask_torch)*img+mask_torch*img*0.7+mask_torch*col*0.3
43
  return mix.numpy().astype(np.uint8)#overlay_mask(img, mask)
44
 
45
  def overlay_mask(img, mask):
 
38
  col=col/col.max()
39
  mask_torch=torch.from_numpy(mask).squeeze().unsqueeze(2).repeat(1,1,3)
40
  maks_torch=mask_torch/mask_torch.max()
41
+ #col[:,:,0]=0
42
+ mix = (1-mask_torch)*img+mask_torch*img*0.5+mask_torch*col*0.5
43
  return mix.numpy().astype(np.uint8)#overlay_mask(img, mask)
44
 
45
  def overlay_mask(img, mask):