Spaces:
Running
on
Zero
Running
on
Zero
File size: 448 Bytes
42c0eb9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import os
from PIL import Image
from torchvision import transforms
src_dir = "other_exps"
tar_dir = "1024_interp"
image_dir = os.listdir(src_dir)
for image in image_dir:
if 'txt' not in image:
img = Image.open(os.path.join(src_dir, image))
T = transforms.Compose([
transforms.Resize(576),
transforms.CenterCrop((576, 1024))
])
img = T(img)
img.save(os.path.join(tar_dir, image)) |