pierreguillou commited on
Commit
cdae7a0
1 Parent(s): 17b8d6c

Update files/functions.py

Browse files
Files changed (1) hide show
  1. files/functions.py +2 -3
files/functions.py CHANGED
@@ -225,7 +225,8 @@ def set_image_dpi_resize(image):
225
  length_x, width_y = image.size
226
  factor = min(1, float(1024.0 / length_x))
227
  size = int(factor * length_x), int(factor * width_y)
228
- image_resize = image.resize(size, Image.Resampling.LANCZOS)
 
229
  temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='1.png')
230
  temp_filename = temp_file.name
231
  image_resize.save(temp_filename, dpi=(300, 300))
@@ -565,8 +566,6 @@ class CustomDataset(Dataset):
565
 
566
  import torch.nn.functional as F
567
 
568
- import torch.nn.functional as F
569
-
570
  # get predictions at token level
571
  def predictions_token_level(images, custom_encoded_dataset):
572
 
 
225
  length_x, width_y = image.size
226
  factor = min(1, float(1024.0 / length_x))
227
  size = int(factor * length_x), int(factor * width_y)
228
+ # image_resize = image.resize(size, Image.Resampling.LANCZOS)
229
+ image_resize = image.resize(size, Image.LANCZOS)
230
  temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='1.png')
231
  temp_filename = temp_file.name
232
  image_resize.save(temp_filename, dpi=(300, 300))
 
566
 
567
  import torch.nn.functional as F
568
 
 
 
569
  # get predictions at token level
570
  def predictions_token_level(images, custom_encoded_dataset):
571