ソースを参照

add check information

mamingjie-China 5 年 前
コミット
cf479e8a8c

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