|
68 | 68 | def save_to_cache( |
69 | 69 | probabilities: list[da.Array], |
70 | 70 | coordinates: list[da.Array], |
71 | | - probabilities_zarr: zarr.Array, |
72 | | - coordinates_zarr: zarr.Array, |
| 71 | + probabilities_zarr: zarr.Array | None, |
| 72 | + coordinates_zarr: zarr.Array | None, |
73 | 73 | save_path: str | Path = "temp.zarr", |
74 | 74 | ) -> tuple[zarr.Array, zarr.Array]: |
75 | 75 | """Save computed feature and coordinate arrays to Zarr cache. |
@@ -217,7 +217,7 @@ def __init__( |
217 | 217 | self.process_prediction_per_batch = False |
218 | 218 |
|
219 | 219 | def infer_wsi( |
220 | | - self: SemanticSegmentor, |
| 220 | + self: DeepFeatureExtractor, |
221 | 221 | dataloader: DataLoader, |
222 | 222 | save_path: Path, |
223 | 223 | **kwargs: Unpack[SemanticSegmentorRunParams], |
@@ -251,7 +251,6 @@ def infer_wsi( |
251 | 251 | # Default Memory threshold percentage is 80. |
252 | 252 | memory_threshold = kwargs.get("memory_threshold", 80) |
253 | 253 | vm = psutil.virtual_memory() |
254 | | - _ = save_path |
255 | 254 | keys = ["probabilities", "coordinates"] |
256 | 255 | probabilities, coordinates = [], [] |
257 | 256 |
|
@@ -376,7 +375,7 @@ def post_process_patches( |
376 | 375 | return raw_predictions |
377 | 376 |
|
378 | 377 | def save_predictions( |
379 | | - self: SemanticSegmentor, |
| 378 | + self: DeepFeatureExtractor, |
380 | 379 | processed_predictions: dict, |
381 | 380 | output_type: str, |
382 | 381 | save_path: Path | None = None, |
@@ -418,7 +417,7 @@ def save_predictions( |
418 | 417 | ) |
419 | 418 |
|
420 | 419 | def _update_run_params( |
421 | | - self: SemanticSegmentor, |
| 420 | + self: DeepFeatureExtractor, |
422 | 421 | images: list[os.PathLike | Path | WSIReader] | np.ndarray, |
423 | 422 | masks: list[os.PathLike | Path] | np.ndarray | None = None, |
424 | 423 | labels: list | None = None, |
@@ -539,7 +538,7 @@ def run( |
539 | 538 |
|
540 | 539 | Raises: |
541 | 540 | ValueError: |
542 | | - If `output_type` is not "zarr". |
| 541 | + If `output_type` is not "zarr" or "dict". |
543 | 542 | """ |
544 | 543 | # return_probabilities is always True for FeatureExtractor. |
545 | 544 | kwargs["return_probabilities"] = True |
|
0 commit comments