Spaces:
Running
Running
Update app.py
Browse files[fix]mask_torch not defined
app.py
CHANGED
|
@@ -34,7 +34,8 @@ def generate_mask(img, coord):
|
|
| 34 |
#
|
| 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 |
col = torch.from_numpy(mask).squeeze()
|
| 37 |
-
mask_torch=torch.from_numpy(mask).squeeze()
|
|
|
|
| 38 |
col[:,:,0]=0
|
| 39 |
mix = (1-mask_torch)*img+mask_torch*img*0.7+mask_torch*col*0.3
|
| 40 |
return mix.numpy().astype(np.uint8)#overlay_mask(img, mask)
|
|
|
|
| 34 |
#
|
| 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 |
col = torch.from_numpy(mask).squeeze()
|
| 37 |
+
mask_torch=torch.from_numpy(mask).squeeze()
|
| 38 |
+
maks_torch=mask_torch/mask_torch.max()
|
| 39 |
col[:,:,0]=0
|
| 40 |
mix = (1-mask_torch)*img+mask_torch*img*0.7+mask_torch*col*0.3
|
| 41 |
return mix.numpy().astype(np.uint8)#overlay_mask(img, mask)
|