未验证 提交 83210bc9 编写于 作者: J Jason 提交者: GitHub

Merge pull request #273 from mamingjie-China/develop

添加数据切分过程中的校验,当图片与标注文件不对应时,提示错误
......@@ -39,6 +39,9 @@ def split_seg_dataset(dataset_dir, val_percent, test_percent, save_dir):
anno_name = replace_ext(image_file, "PNG")
if osp.exists(osp.join(dataset_dir, "Annotations", anno_name)):
image_anno_list.append([image_file, anno_name])
else:
logging.error("The annotation file {} doesn't exist!".format(
anno_name))
if not osp.exists(osp.join(dataset_dir, "labels.txt")):
for image_anno in image_anno_list:
......
......@@ -47,6 +47,9 @@ def split_voc_dataset(dataset_dir, val_percent, test_percent, save_dir):
cname = obj.find('name').text
if not cname in label_list:
label_list.append(cname)
else:
logging.error("The annotation file {} doesn't exist!".format(
anno_name))
random.shuffle(image_anno_list)
image_num = len(image_anno_list)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册