import numpy as np
from PIL import Image

from os import listdir
from os.path import isfile, join
mypath = "metfacesimages/images/"
onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]
out_folder = "resized_images/"
for i, img_file in enumerate(onlyfiles):
    if i%50 == 0:
        print("Done with %s images"% (i))
    img = Image.open(mypath + img_file)
    img1 = img.resize((128, 128), Image.ANTIALIAS)
    img1.save(out_folder + img_file)
