Spaces:
Running
Running
Update app.py
Browse files[fix] col out of index
app.py
CHANGED
|
@@ -34,7 +34,7 @@ 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 |
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
|
|
|
|
| 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().unsqueeze(2).repeat(1,1,3)
|
| 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
|