From c6a8201e4bdfb9d0f3e8d2648687af7c71284c8d Mon Sep 17 00:00:00 2001 From: "552068321@qq.com" Date: Mon, 7 Nov 2022 17:21:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0data=5Flist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/file_tool.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/file_tool.py b/app/file_tool.py index f85d840..28178c4 100644 --- a/app/file_tool.py +++ b/app/file_tool.py @@ -179,7 +179,7 @@ def get_file(ori_path: str, type_list: Union[object,str]): test_files = [] # 训练、测试比例强制9:1 for img in imgs[0:1]: - path = ori_path + 'images/' +img + path = ori_path + '/images/' +img # print(os.path.exists(path)) print('图像路径',path) if os.path.exists(path): @@ -187,18 +187,18 @@ def get_file(ori_path: str, type_list: Union[object,str]): print('1111') #label = ori_path + 'labels/' + os.path.split(path)[1] (filename1, extension) = os.path.splitext(img) # 文件名与后缀名分开 - label = ori_path + 'labels/' + filename1 + '.json' + label = ori_path + '/labels/' + filename1 + '.json' print('标签',label) if label is not None: #train_files.append(label) test_files.append(label) print('2222') for img in imgs[1:]: - path = ori_path + 'images/' +img + path = ori_path + '/images/' +img if os.path.exists(path): train_files.append(path) (filename2, extension) = os.path.splitext(img) # 文件名与后缀名分开 - label = ori_path + 'labels/' + filename2 + '.json' + label = ori_path + '/labels/' + filename2 + '.json' if label is not None: train_files.append(label)