Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- path_to_old_images = '/unsupervised-old'
- path_to_new_images = '/unsupervised-new'
- images_per_directory = 1000
- for i, filename in enumerate(os.listdir(path)):
- if i % images_per_directory == 0:
- target_dir = os.path.join(path_to_new_images, '{:05}'.format(i))
- os.system('mkdir -p {}'.format(target_dir))
- source = os.path.join(path_to_old_images, filename)
- target = os.path.join(target_dir, filename)
- os.system('cp {} {}'.format(source, target))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement