[Fix] Fix Dataset Preparer Extract (#1527)

* fix a case when re-run the preparer might repeatly download annotation

* fix comments

* update

* fix
pull/1532/head
Xinyu Wang 2022-11-15 18:54:47 +08:00 committed by GitHub
parent 79a778689d
commit 99c86a74b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -99,10 +99,9 @@ class NaiveDataObtainer:
delete (bool, optional): Whether to delete the zip file. Defaults
to False.
"""
if not is_archive(src_path):
# Move the file to the destination folder if it is not a zip
shutil.move(src_path, dst_path)
if not is_archive(src_path) and not osp.exists(dst_path):
# Copy the file to the destination folder if it is not a zip
shutil.copy(src_path, dst_path)
return
zip_name = osp.basename(src_path).split('.')[0]