Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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),
|