PyTorch version to screen and cleanup (#1325)
* Create flatten_recursive() helper function * cleanup * print torch version
This commit is contained in:
1 parent
81d320109f
commit
19e2482458
4 files changed
+18
-11
No files matched your search
@@ -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)
|
||||
Reference in new issue
Block a user