Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. import os
  2. import shutil
  3.  
  4. train_dir = '/content/train'
  5. dest_dir = '/content/all_images'
  6. counter = 0
  7.  
  8. for subdir, dirs, files in os.walk(train_dir):
  9. #print(files)
  10. for file in files:
  11. full_path = os.path.join(subdir, file)
  12. shutil.copy(full_path, dest_dir)
  13. counter = counter + 1
  14. print(counter)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement