PyTorch version to screen and cleanup (#1325)

* Create flatten_recursive() helper function

* cleanup

* print torch version
This commit is contained in:
Glenn Jocher authored and GitHub committed 2020-11-09 12:24:11 +01:00
1 parent 81d320109f
commit 19e2482458
4 files changed
+18 -11

No files matched your search

+8
View File
@@ -946,3 +946,11 @@ def create_folder(path='./new'):
if os.path.exists(path):
shutil.rmtree(path) # delete output folder
os.makedirs(path) # make new output folder
def flatten_recursive(path='../coco128'):
# Flatten a recursive directory by bringing all files to top level
new_path = Path(path + '_flat')
create_folder(new_path)
for file in tqdm(glob.glob(str(Path(path)) + '/**/*.*', recursive=True)):
shutil.copyfile(file, new_path / Path(file).name)