Skip to content

Commit

Permalink
option to change pred suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
haruishi43 committed Nov 19, 2022
1 parent cebc741 commit 0f94c1f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pyEdgeEval/evaluators/sbd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
10 changes: 10 additions & 0 deletions pyEdgeEval/helpers/evaluate_sbd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pyEdgeEval/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 0f94c1f

Please sign in to comment.