diff --git a/pyEdgeEval/evaluators/sbd.py b/pyEdgeEval/evaluators/sbd.py index b84f30f..087fbac 100644 --- a/pyEdgeEval/evaluators/sbd.py +++ b/pyEdgeEval/evaluators/sbd.py @@ -48,6 +48,7 @@ def __init__( split: str = "val", cls_dir: str = "cls", inst_dir: str = "inst", + pred_suffix=None, **kwargs, ): self.dataset_root = dataset_root @@ -65,6 +66,10 @@ def __init__( inst_dir, ) + if pred_suffix is not None: + print_log(f"changed suffix to {pred_suffix}") + self.PRED_SUFFIX = pred_suffix + # we can try to load some sample names try: self.set_sample_names() diff --git a/pyEdgeEval/helpers/evaluate_sbd.py b/pyEdgeEval/helpers/evaluate_sbd.py index 84f98ff..3378e5f 100644 --- a/pyEdgeEval/helpers/evaluate_sbd.py +++ b/pyEdgeEval/helpers/evaluate_sbd.py @@ -34,6 +34,12 @@ def parse_args(): default="inst_orig", help="directory name for instance labels", ) + parser.add_argument( + "--pred-suffix", + type=str, + default=".png", + help="suffix for predicted images", + ) parser.add_argument( "--output-path", type=str, @@ -81,6 +87,7 @@ def evaluate( pred_path: str, cls_dir: str, inst_dir: str, + pred_suffix: str, output_path: str, categories: str, apply_thinning: bool, @@ -160,6 +167,7 @@ def evaluate( logger.info(f"nms: \t{apply_nms}") logger.info(f"cls_dir: \t{cls_dir}") logger.info(f"inst_dir: \t{inst_dir}") + logger.info(f"pred_suffix:\t{pred_suffix}") print("\n\n") # initialize evaluator @@ -168,6 +176,7 @@ def evaluate( pred_root=pred_path, cls_dir=cls_dir, inst_dir=inst_dir, + pred_suffix=pred_suffix, ) if evaluator.sample_names is None: # load custom sample names @@ -204,6 +213,7 @@ def evaluate_sbd(): pred_path=args.pred_path, cls_dir=args.cls_dir, inst_dir=args.inst_dir, + pred_suffix=args.pred_suffix, output_path=args.output_path, categories=args.categories, apply_thinning=apply_thinning, diff --git a/pyEdgeEval/info.py b/pyEdgeEval/info.py index bc2eb3f..fdfa95c 100644 --- a/pyEdgeEval/info.py +++ b/pyEdgeEval/info.py @@ -2,7 +2,7 @@ """Information about this library""" -__version__ = "0.2.2" +__version__ = "0.2.3" __author__ = "haruishi43" __email__ = "haruyaishikawa@keio.jp" __description__ = "Python Edge Evaluation Tools"