提交 cf479e8a 编写于 作者: M mamingjie-China

add check information

上级 f1bc0bac
...@@ -39,6 +39,9 @@ def split_seg_dataset(dataset_dir, val_percent, test_percent, save_dir): ...@@ -39,6 +39,9 @@ def split_seg_dataset(dataset_dir, val_percent, test_percent, save_dir):
anno_name = replace_ext(image_file, "PNG") anno_name = replace_ext(image_file, "PNG")
if osp.exists(osp.join(dataset_dir, "Annotations", anno_name)): if osp.exists(osp.join(dataset_dir, "Annotations", anno_name)):
image_anno_list.append([image_file, 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")): if not osp.exists(osp.join(dataset_dir, "labels.txt")):
for image_anno in image_anno_list: for image_anno in image_anno_list:
......
...@@ -47,6 +47,9 @@ def split_voc_dataset(dataset_dir, val_percent, test_percent, save_dir): ...@@ -47,6 +47,9 @@ def split_voc_dataset(dataset_dir, val_percent, test_percent, save_dir):
cname = obj.find('name').text cname = obj.find('name').text
if not cname in label_list: if not cname in label_list:
label_list.append(cname) label_list.append(cname)
else:
logging.error("The annotation file {} doesn't exist!".format(
anno_name))
random.shuffle(image_anno_list) random.shuffle(image_anno_list)
image_num = len(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.
先完成此消息的编辑!
想要评论请 注册