Created
January 20, 2018 09:55
-
-
Save tuttelikz/f1b5d25b19cec59422131fa62d22ec65 to your computer and use it in GitHub Desktop.
Simple gist for opening directory, sorting and writing text
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
import glob | |
from PIL import Image | |
img_dir_path = 'data_cheek/*.jpg' | |
train_test_filelist = sorted(glob.glob(img_dir_path)) | |
cheek_label_list = [0 if "old" in files else 1 for files in train_test_filelist] | |
thefile = open('data_cheek.txt', 'w') | |
for item in cheek_label_list: | |
thefile.write("%s\n" % item) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment