提交 0be30344 编写于 作者: K Kaipeng Deng 提交者: GitHub

refine auto download logs (#3330)

* refine auto download logs
上级 94299aa8
...@@ -81,7 +81,7 @@ def get_dataset_path(path, annotation, image_dir): ...@@ -81,7 +81,7 @@ def get_dataset_path(path, annotation, image_dir):
if _dataset_exists(path, annotation, image_dir): if _dataset_exists(path, annotation, image_dir):
return path return path
logger.info("Dataset {} not exists, try searching {} or " logger.info("Dataset {} is not valid for reason above, try searching {} or "
"downloading dataset...".format( "downloading dataset...".format(
osp.realpath(path), DATASET_HOME)) osp.realpath(path), DATASET_HOME))
...@@ -125,7 +125,9 @@ def get_dataset_path(path, annotation, image_dir): ...@@ -125,7 +125,9 @@ def get_dataset_path(path, annotation, image_dir):
return data_dir return data_dir
# not match any dataset in DATASETS # not match any dataset in DATASETS
raise ValueError("{} not exists or unknow dataset type".format(path)) raise ValueError("Dataset {} is not valid and cannot parse dataset type "
"'{}' for automaticly downloading, which only supports "
"'voc' and 'coco' currently".format(path, osp.split(path)[-1]))
def get_path(url, root_dir, md5sum=None): def get_path(url, root_dir, md5sum=None):
...@@ -171,20 +173,23 @@ def _dataset_exists(path, annotation, image_dir): ...@@ -171,20 +173,23 @@ def _dataset_exists(path, annotation, image_dir):
Check if user define dataset exists Check if user define dataset exists
""" """
if not osp.exists(path): if not osp.exists(path):
logger.info("Config dataset_dir {} not exits".format(path)) logger.info("Config dataset_dir {} is not exits, "
"dataset config is not valid".format(path))
return False return False
if annotation: if annotation:
annotation_path = osp.join(path, annotation) annotation_path = osp.join(path, annotation)
if not osp.isfile(annotation_path): if not osp.isfile(annotation_path):
logger.info("Config annotation {} is not a " logger.info("Config annotation {} is not a "
"file".format(annotation_path)) "file, dataset config is not "
"valid".format(annotation_path))
return False return False
if image_dir: if image_dir:
image_path = osp.join(path, image_dir) image_path = osp.join(path, image_dir)
if not osp.isdir(image_path): if not osp.isdir(image_path):
logger.info("Config image_dir {} is not a " logger.info("Config image_dir {} is not a "
"directory".format(image_path)) "directory, dataset config is not "
"valid".format(image_path))
return False return False
return True return True
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册