瀏覽代碼

add check information

mamingjie-China 5 年之前
父節點
當前提交
cf479e8a8c
共有 2 個文件被更改,包括 6 次插入0 次删除
  1. 3 0
      paddlex/tools/dataset_split/seg_split.py
  2. 3 0
      paddlex/tools/dataset_split/voc_split.py

+ 3 - 0
paddlex/tools/dataset_split/seg_split.py

@@ -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:

+ 3 - 0
paddlex/tools/dataset_split/voc_split.py

@@ -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)