Python 2.7 script to go through sub directories


PHOTO EMBED

Sun Feb 16 2020 18:21:25 GMT+0000 (UTC)

Saved by @aiastronaut #python

listing = os.listdir(path) 
num_samples=size(listing)
print num_samples

for file in listing:
    im = Image.open(path1 + '/' + file)   
    img = im.resize((img_rows,img_cols))
    gray = img.convert('L')
    gray.save(path2 +'/' +  file, "PNG")
content_copyCOPY