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

Update app.py

Browse files

[fix] norm col

Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -35,6 +35,7 @@ def generate_mask(img, coord):
35
  mask = sepia((img*0.999999).astype(np.uint8),(img*0.999999).astype(np.uint8),(img*0.999999).astype(np.uint8),(img*0.999999).astype(np.uint8),(img*0.999999).astype(np.uint8), stack_image=False)
36
  mask = F.interpolate(torch.from_numpy(mask).unsqueeze(0).unsqueeze(0),size=[img.shape[0],img.shape[1]],mode='bilinear').squeeze().numpy()
37
  col = torch.from_numpy(mask).squeeze().unsqueeze(2).repeat(1,1,3)
 
38
  mask_torch=torch.from_numpy(mask).squeeze().unsqueeze(2).repeat(1,1,3)
39
  maks_torch=mask_torch/mask_torch.max()
40
  col[:,:,0]=0
 
35
  mask = sepia((img*0.999999).astype(np.uint8),(img*0.999999).astype(np.uint8),(img*0.999999).astype(np.uint8),(img*0.999999).astype(np.uint8),(img*0.999999).astype(np.uint8), stack_image=False)
36
  mask = F.interpolate(torch.from_numpy(mask).unsqueeze(0).unsqueeze(0),size=[img.shape[0],img.shape[1]],mode='bilinear').squeeze().numpy()
37
  col = torch.from_numpy(mask).squeeze().unsqueeze(2).repeat(1,1,3)
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