Selaa lähdekoodia

update some log

mamingjie-China 5 vuotta sitten
vanhempi
commit
ca4a7224e8

+ 6 - 3
paddlex/command.py

@@ -93,7 +93,10 @@ def arg_parser():
         default=False,
         help="split dataset with the split value")
     parser.add_argument(
-        "--form", "-f", default=None, help="define dataset format")
+        "--form",
+        "-f",
+        default=None,
+        help="define dataset format(ImageNet/COCO/VOC/Seg)")
     parser.add_argument(
         "--dataset_dir",
         "-dd",
@@ -104,12 +107,12 @@ def arg_parser():
         "--val_value",
         "-vv",
         default=None,
-        help="define the value of validation dataset")
+        help="define the value of validation dataset(E.g 0.2)")
     parser.add_argument(
         "--test_value",
         "-tv",
         default=None,
-        help="define the value of test dataset")
+        help="define the value of test dataset(E.g 0.1)")
     return parser
 
 

+ 3 - 3
paddlex/tools/dataset_split/coco_split.py

@@ -16,19 +16,19 @@ import os.path as osp
 import random
 import json
 from .utils import MyEncoder
+import paddlex.utils.logging as logging
 
 
 def split_coco_dataset(dataset_dir, val_percent, test_percent, save_dir):
     if not osp.exists(osp.join(dataset_dir, "annotations.json")):
-        raise ValueError("\'annotations.json\' is not found in {}!".format(
+        logging.error("\'annotations.json\' is not found in {}!".format(
             dataset_dir))
     try:
         from pycocotools.coco import COCO
     except:
-        print(
+        logging.error(
             "pycococotools is not installed, follow this doc install pycocotools: https://paddlex.readthedocs.io/zh_CN/develop/install.html#pycocotools"
         )
-        return
 
     annotation_file = osp.join(dataset_dir, "annotations.json")
     coco = COCO(annotation_file)

+ 1 - 0
paddlex/tools/dataset_split/imagenet_split.py

@@ -15,6 +15,7 @@
 import os.path as osp
 import random
 from .utils import list_files, is_pic
+import paddlex.utils.logging as logging
 
 
 def split_imagenet_dataset(dataset_dir, val_percent, test_percent, save_dir):

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

@@ -15,14 +15,14 @@
 import os.path as osp
 import random
 from .utils import list_files, is_pic, replace_ext, read_seg_ann
+import paddlex.utils.logging as logging
 
 
 def split_seg_dataset(dataset_dir, val_percent, test_percent, save_dir):
     if not osp.exists(osp.join(dataset_dir, "JPEGImages")):
-        raise ValueError("\'JPEGImages\' is not found in {}!".format(
-            dataset_dir))
+        logging.error("\'JPEGImages\' is not found in {}!".format(dataset_dir))
     if not osp.exists(osp.join(dataset_dir, "Annotations")):
-        raise ValueError("\'Annotations\' is not found in {}!".format(
+        logging.error("\'Annotations\' is not found in {}!".format(
             dataset_dir))
 
     all_image_files = list_files(osp.join(dataset_dir, "JPEGImages"))

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

@@ -16,14 +16,14 @@ import os.path as osp
 import random
 import xml.etree.ElementTree as ET
 from .utils import list_files, is_pic, replace_ext
+import paddlex.utils.logging as logging
 
 
 def split_voc_dataset(dataset_dir, val_percent, test_percent, save_dir):
     if not osp.exists(osp.join(dataset_dir, "JPEGImages")):
-        raise ValueError("\'JPEGImages\' is not found in {}!".format(
-            dataset_dir))
+        logging.error("\'JPEGImages\' is not found in {}!".format(dataset_dir))
     if not osp.exists(osp.join(dataset_dir, "Annotations")):
-        raise ValueError("\'Annotations\' is not found in {}!".format(
+        logging.error("\'Annotations\' is not found in {}!".format(
             dataset_dir))
 
     all_image_files = list_files(osp.join(dataset_dir, "JPEGImages"))