Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions gatherImages.py
Original file line number Diff line number Diff line change
@@ -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
)