diff --git a/src/ptbench/engine/saliencymap_evaluator.py b/src/ptbench/engine/saliencymap_evaluator.py index 7871cefbc7c497f10f5d27f347cb31a6c07a8563..9a5fc15680fb433a68e669422f894b56b044ba8a 100644 --- a/src/ptbench/engine/saliencymap_evaluator.py +++ b/src/ptbench/engine/saliencymap_evaluator.py @@ -93,8 +93,6 @@ def _extract_bounding_box( * width (pixels) * height (pixels) """ - # opencv implementation: - # x, y, w, h = cv2.boundingRect(mask.astype(numpy.uint8)) x, y, x2, y2 = torchvision.ops.masks_to_boxes(torch.tensor(mask)[None, :])[ 0 ] @@ -330,14 +328,15 @@ def run( retval: dict[str, list[typing.Any]] = {} + # TODO: This loads the images from the dataset, but they are not useful at + # this point. Possibly using the contents of ``datamodule.splits`` can + # substantially speed this up. for dataset_name, dataset_loader in datamodule.predict_dataloader().items(): logger.info( f"Estimating interpretability metrics for dataset `{dataset_name}`..." ) retval[dataset_name] = [] - # TODO: This loads the images from the dataset, but they are not useful at - # this point... for sample in tqdm( dataset_loader, desc="batches", leave=False, disable=None ):