Skip to content

Commit 20362ef

Browse files
committed
🐛 Fix output path for annotationstore output.
1 parent d773206 commit 20362ef

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

tests/engines/test_patch_predictor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def test_cli_model_single_file(sample_svs: Path, tmp_path: Path) -> None:
490490
)
491491

492492
assert models_wsi_result.exit_code == 0
493-
assert (tmp_path / "output" / "output.db").exists()
493+
assert (tmp_path / "output" / (sample_svs.stem + ".db")).exists()
494494

495495

496496
def test_cli_model_multiple_file_mask(remote_sample: Callable, tmp_path: Path) -> None:

tiatoolbox/models/engine/engine_abc.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,9 +673,7 @@ def save_predictions(
673673
) and output_type.lower() != "annotationstore":
674674
return processed_predictions
675675

676-
output_file = Path(kwargs.get("output_file", "output.db"))
677-
678-
save_path = save_dir / output_file
676+
save_path = Path(kwargs.get("output_file", save_dir / "output.db"))
679677

680678
if output_type.lower() == "annotationstore":
681679
# scale_factor set from kwargs
@@ -1063,6 +1061,7 @@ def _run_wsi_mode(
10631061
raw_predictions=raw_predictions,
10641062
**kwargs,
10651063
)
1064+
kwargs["output_file"] = out[image]
10661065
out[image] = self.save_predictions(
10671066
processed_predictions=processed_predictions,
10681067
output_type=output_type,

0 commit comments

Comments
 (0)