Last active
April 24, 2017 13:09
-
-
Save amoshyc/9acb3263eeda8966e25b1b567b80e733 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from sys import argv | |
from scipy.misc import imread, imresize, imsave | |
input_dir = argv[1] | |
output_dir = './out/' | |
os.makedirs(output_dir, exist_ok=True) | |
filenames = sorted(os.listdir(input_dir)) | |
for fn in filenames: | |
img = imread(os.path.join(input_dir, fn)) | |
img = imresize(img, 0.7) | |
imsave(output_dir + fn[:-4] + '.jpg', img) | |
print(fn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment