Spaces:
Running
Running
Update app.py
Browse files[fix] norm col
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
|