Created
June 3, 2018 16:19
-
-
Save nunenuh/780dbd9c5304475812c7b0b1f379b791 to your computer and use it in GitHub Desktop.
Mogrify Rescale with python automate
This file contains hidden or 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
import os | |
base_path = '/home/nunenuh/Desktop/skripsi/dataset/testing' | |
def rescale(base_path,percent): | |
dirz = os.listdir(base_path) | |
my_list = [] | |
for dr in dirz: | |
path = os.path.join(base_path, dr,'*.jpg') | |
my_list.append(path) | |
for pt in my_list: | |
str_scr = 'mogrify -scale '+str(percent)+'% "'+pt+'"' | |
os.system(str_scr) | |
rescale(base_path, 12.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment