javierabad01 commited on
Commit
8ab7ee2
·
verified ·
1 Parent(s): 9e2ef13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -42,13 +42,14 @@ def process_img(image):
42
  img = np.array(image)
43
  img = img / 255.
44
  img = img.astype(np.float32)
 
 
 
 
45
  y = torch.tensor(img).permute(2,0,1).unsqueeze(0).to(device)
46
- _, _, H, W = y.shape
47
- y= check_image_size(y)
48
 
49
  with torch.no_grad():
50
  x_hat = model(y)
51
- x_hat = x_hat[:, :, :H, :W]
52
 
53
  restored_img = x_hat.squeeze().permute(1,2,0).clamp_(0, 1).cpu().detach().numpy()
54
  restored_img = np.clip(restored_img, 0. , 1.)
 
42
  img = np.array(image)
43
  img = img / 255.
44
  img = img.astype(np.float32)
45
+
46
+ resize = transforms.Resize((720, 1280))
47
+ mask_rgb = resize(mask_rgb)
48
+
49
  y = torch.tensor(img).permute(2,0,1).unsqueeze(0).to(device)
 
 
50
 
51
  with torch.no_grad():
52
  x_hat = model(y)
 
53
 
54
  restored_img = x_hat.squeeze().permute(1,2,0).clamp_(0, 1).cpu().detach().numpy()
55
  restored_img = np.clip(restored_img, 0. , 1.)