Created
April 28, 2019 19:32
-
-
Save alonlavian/75da6648a4ab64735e4e76e8f192c7ef to your computer and use it in GitHub Desktop.
crops all jpg in a folder and saves all cropped faces to the destination folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
original_images_dir = os.fsencode('/content/drive/My Drive/Google Photos/2019') | |
cropped_images_lib = '/content/drive/My Drive/CropMix/' | |
for path, dirs, files in os.walk(original_images_dir): | |
for file in files: | |
image_name = os.fsdecode(file) | |
if image_name.endswith(".jpg"): | |
image_path = os.path.join(path,file) | |
crop_faces(image_path,image_name,cropped_images_lib) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment