Obai33 commited on
Commit
afa022d
·
verified ·
1 Parent(s): cb49109

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -36,12 +36,12 @@ def fit_picture(img):
36
  resize_width = int(target_height * aspect_ratio)
37
 
38
  # Resize transformation
39
- resize_transform = transforms.Resize((resize_height, resize_width))
40
 
41
  # Pad transformation
42
  padding_height = (target_height - resize_height) if target_height > resize_height else 0
43
  padding_width = (target_width - resize_width) if target_width > resize_width else 0
44
- pad_transform = transforms.Pad((0, 0, padding_width, padding_height), fill=0, padding_mode='constant')
45
 
46
  transformss = torchvision.transforms.Compose([
47
  torchvision.transforms.Grayscale(num_output_channels = 1),
 
36
  resize_width = int(target_height * aspect_ratio)
37
 
38
  # Resize transformation
39
+ resize_transform = torchvision.transforms.Resize((resize_height, resize_width))
40
 
41
  # Pad transformation
42
  padding_height = (target_height - resize_height) if target_height > resize_height else 0
43
  padding_width = (target_width - resize_width) if target_width > resize_width else 0
44
+ pad_transform = torchvision.transforms.Pad((0, 0, padding_width, padding_height), fill=0, padding_mode='constant')
45
 
46
  transformss = torchvision.transforms.Compose([
47
  torchvision.transforms.Grayscale(num_output_channels = 1),