kavitha-19 commited on
Commit
120bfbe
·
1 Parent(s): cdd7e4a

updated code

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. utils.py +4 -2
app.py CHANGED
@@ -19,7 +19,7 @@ import os
19
  import sys
20
  import time
21
  import re
22
-
23
  import numpy as np
24
  import torch
25
  from torch.optim import Adam
 
19
  import sys
20
  import time
21
  import re
22
+ # from PIL import ImageFilter, ImageResampling
23
  import numpy as np
24
  import torch
25
  from torch.optim import Adam
utils.py CHANGED
@@ -1,13 +1,15 @@
1
  import torch
2
  from PIL import Image
3
-
4
 
5
  def load_image(filename, size=None, scale=None):
6
  img = Image.open(filename).convert('RGB')
7
  if size is not None:
8
  img = img.resize((size, size), Image.ANTIALIAS)
9
  elif scale is not None:
10
- img = img.resize((int(img.size[0] / scale), int(img.size[1] / scale)), Image.ANTIALIAS)
 
 
11
  return img
12
 
13
 
 
1
  import torch
2
  from PIL import Image
3
+ from PIL import ImageFilter
4
 
5
  def load_image(filename, size=None, scale=None):
6
  img = Image.open(filename).convert('RGB')
7
  if size is not None:
8
  img = img.resize((size, size), Image.ANTIALIAS)
9
  elif scale is not None:
10
+ # img = img.resize((int(img.size[0] / scale), int(img.size[1] / scale)), Image.ANTIALIAS)
11
+ img = img.resize((int(img.size[0] / scale), int(img.size[1] / scale)), Image.Resampling.LANCZOS)
12
+
13
  return img
14
 
15