Skip to content

Commit f5a8f77

Browse files
committed
update 制作文件夹时先删除原有的数据集
1 parent 18c2f21 commit f5a8f77

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

dataset_tools/jade_create_paddle_text_detection_datasets.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,11 @@ def CreateTextDetDatasets(root_path, save_root_path, split_rate=0.9):
327327
createDatasets(save_root_path)
328328

329329
def create_text_detection_datasets(root_path,save_path,split_rate=0.95):
330+
if os.path.exists(save_path):
331+
try:
332+
shutil.rmtree(save_path)
333+
except:
334+
print("文件夹删除失败,文件夹名称为:{}".format(save_path))
330335
file_list = os.listdir(root_path)
331336
for file_name in file_list:
332337
CreateTextDetDatasets(os.path.join(root_path, file_name),save_path,split_rate)

0 commit comments

Comments
 (0)