From 38eadeb2d747973914f1bd01dca108c236344d36 Mon Sep 17 00:00:00 2001 From: henry fritz Date: Tue, 21 Dec 2021 00:30:03 -0500 Subject: [PATCH] Create gatherImages.py need to update javascript as well on this --- gatherImages.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 gatherImages.py diff --git a/gatherImages.py b/gatherImages.py new file mode 100644 index 0000000..dacaa32 --- /dev/null +++ b/gatherImages.py @@ -0,0 +1,22 @@ +import glob +import os +import uuid +from PIL import Image + +my_path = "batch/" +main_dir = "filteredImages/" +files = glob.glob(my_path + '/**/*.jpg', recursive=True) + +for file in files: + im = Image.open(file) + if (im.width<512 or im.height<512): + print("Image too small: " + file) + continue + # Generate guid + im.close() + guid = str(uuid.uuid4()) + filename=guid + ".jpg" + os.rename( + file, + main_dir + filename + )