Thouph commited on
Commit
a142643
1 Parent(s): 5c38f17

Upload inference.py

Browse files
Files changed (1) hide show
  1. inference.py +1 -1
inference.py CHANGED
@@ -26,7 +26,7 @@ img = Image.open(image_path).convert('RGB')
26
  aspect_ratio = img.width / img.height
27
  new_height = math.sqrt(512 ** 2 / aspect_ratio)
28
  new_width = aspect_ratio * new_height
29
- img.resize((int(new_width), int(new_height)), Image.LANCZOS)
30
  tensor = transform(img).unsqueeze(0).to(device)
31
  with torch.no_grad():
32
  out = model(tensor)
 
26
  aspect_ratio = img.width / img.height
27
  new_height = math.sqrt(512 ** 2 / aspect_ratio)
28
  new_width = aspect_ratio * new_height
29
+ img.thumbnail((int(new_width), int(new_height)), Image.LANCZOS)
30
  tensor = transform(img).unsqueeze(0).to(device)
31
  with torch.no_grad():
32
  out = model(tensor)