Skip to content

Instantly share code, notes, and snippets.



Created Apr 22, 2020
What would you like to do?
from PIL import Image
from glob import glob
import shutil
import random
import os
files = glob("500x500/*/*")
outputPath = "output3/"
newSize = [400, 400]
for x in files:
dirname = os.path.dirname(x)
os.makedirs(outputPath+x.split("/")[-2]+"/", exist_ok=True)"/")[-2]+"/"+os.path.basename(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment