Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I write something easy to modify. #543

Open
Tiuuuuu opened this issue Jun 27, 2023 · 2 comments
Open

I write something easy to modify. #543

Tiuuuuu opened this issue Jun 27, 2023 · 2 comments

Comments

@Tiuuuuu
Copy link

Tiuuuuu commented Jun 27, 2023

          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 #15 (comment)

@Tiuuuuu
Copy link
Author

Tiuuuuu commented Jun 27, 2023

that is great!!!!!!!!!!!!!!!!!!!

@fittiing
Copy link

May I ask which directory and folder should this file be placed in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants