generative_inpainting
generative_inpainting copied to clipboard
I write something easy to modify.
I write something easy to modify.
from random import shuffle
import os
train_filename = 'G:/image_inpainting/train_shuffled.flist'
validation_filename = 'G:/image_inpainting/validation_shuffled.flist'
training_file_names = []
validation_file_names = []
training_path = 'G:/image_inpainting/training'
validation_path = 'G:/image_inpainting/validation'
training_items = os.listdir(training_path)
validation_items = os.listdir(validation_path)
# loop
for training_item in training_items:
training_item = training_path + training_item
training_file_names.append(training_item)
for validation_item in validation_items:
validation_item = validation_path + validation_item
validation_file_names.append(validation_item)
shuffle(training_file_names)
shuffle(validation_file_names)
# write
fo = open(train_filename, "w")
fo.write("\n".join(training_file_names))
fo.close()
fo = open(validation_filename, "w")
fo.write("\n".join(validation_file_names))
fo.close()
Originally posted by @sdulyq in https://github.com/JiahuiYu/generative_inpainting/issues/15#issuecomment-818359678
that is great!!!!!!!!!!!!!!!!!!!
May I ask which directory and folder should this file be placed in?