Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
4d21d22
:new: Define New MultiTaskSegmentor
shaneahmed Jan 8, 2026
fef42ea
:construction: Add functionalities
shaneahmed Jan 8, 2026
ab5cf7c
:fire: Remove previous codes
shaneahmed Jan 8, 2026
eab6db0
:fire: Remove previous codes
shaneahmed Jan 8, 2026
f8ff99c
:white_check_mark: Add initialization test
shaneahmed Jan 8, 2026
17c7a8a
:boom: Add patch segmentation test
shaneahmed Jan 8, 2026
ced4924
:boom: Update loop for postprocessing
shaneahmed Jan 8, 2026
8ea1056
:boom: Work in progress
shaneahmed Jan 9, 2026
1b9d254
Merge branch 'dev-define-engines-abc' into dev-define-multitask-segme…
shaneahmed Jan 9, 2026
335aa07
:construction: Update multitask post processing outputs.
shaneahmed Jan 9, 2026
3447495
:construction: Update postprocessing to incorporate dictionary outputs
shaneahmed Jan 12, 2026
84a717d
:white_check_mark: Add test for dictionary output
shaneahmed Jan 12, 2026
6065409
:bug: Fix hovernet and hovernetplus tests
shaneahmed Jan 12, 2026
1c6619b
Merge branch 'dev-define-engines-abc' into dev-define-multitask-segme…
shaneahmed Jan 12, 2026
bd6d4b7
:white_check_mark: Add tests for zarr output
shaneahmed Jan 12, 2026
c7238b2
:bug: Fix deepsource errors
shaneahmed Jan 12, 2026
fa3dcc1
:white_check_mark: Add test for single output.
shaneahmed Jan 13, 2026
b042e86
:white_check_mark: Add test for save_dir and None output_type
shaneahmed Jan 13, 2026
47efdd1
:white_check_mark: Improve test coverage.
shaneahmed Jan 13, 2026
618f123
Merge branch 'dev-define-engines-abc' into dev-define-multitask-segme…
shaneahmed Jan 13, 2026
645986d
:white_check_mark: Add test for annotationstore single output.
shaneahmed Jan 13, 2026
d9953cc
Merge branch 'dev-define-engines-abc' into dev-define-multitask-segme…
shaneahmed Jan 13, 2026
e86e176
:white_check_mark: Add tests for multitask annotation store
shaneahmed Jan 13, 2026
4247afa
:white_check_mark: Test output of layer and nuclei segmentation for a…
shaneahmed Jan 13, 2026
94f427e
:white_check_mark: Test output of layer and nuclei segmentation for a…
shaneahmed Jan 13, 2026
b16b57b
:bug: Read image at correct resolution
shaneahmed Jan 13, 2026
8aebbaf
:bug: Fix saving annotationstore using zarr
shaneahmed Jan 13, 2026
e4392c9
:white_check_mark: Add test for logger.
shaneahmed Jan 13, 2026
f9f5f69
:bug: Fix deepsource error `PTC-W0060`
shaneahmed Jan 14, 2026
84a4611
:white_check_mark: Use file paths for a test
shaneahmed Jan 14, 2026
6e1b55f
:bug: Fix paths to input files in test
shaneahmed Jan 14, 2026
99e2352
Merge branch 'dev-define-engines-abc' into dev-define-multitask-segme…
shaneahmed Jan 14, 2026
ff804db
:construction: Add zarr output for WSIs
shaneahmed Jan 16, 2026
04dada4
:bug: Fix deepsource error
shaneahmed Jan 19, 2026
a8ca393
:bug: Fix deepsource error
shaneahmed Jan 19, 2026
a336569
add type annotation utils.transforms.py
Jiaqi-Lv Jan 19, 2026
5717512
:sparkles: Add WSI AnnotationStore support
shaneahmed Jan 19, 2026
568964d
:white_check_mark: Add check for single task and class_dict
shaneahmed Jan 19, 2026
943aebf
:white_check_mark: Add check for single task and class_dict support
shaneahmed Jan 19, 2026
e3830b1
:bug: Fix PY-W0070 deep source error
shaneahmed Jan 19, 2026
528b72e
:zap: Use smaller images for faster test runs.
shaneahmed Jan 19, 2026
8e5578a
:bug: Fix memory check for saving arrays
shaneahmed Jan 20, 2026
60faab5
:lipstick: Update logic for better readability
shaneahmed Jan 20, 2026
ddc2a54
:bug: Remove residual canvas and count keys
shaneahmed Jan 20, 2026
8cd457c
:bug: Fix deepsource errors
shaneahmed Jan 20, 2026
e715f1b
Merge branch 'dev-define-engines-abc' into dev-define-multitask-segme…
shaneahmed Jan 22, 2026
4bb4900
:bug: Fix count in merge_predictions
shaneahmed Jan 23, 2026
5e659c0
:bug: Fix count in merge_predictions
shaneahmed Jan 23, 2026
c0decb6
:bug: Fix HoVerNetPlus postprocessing.
shaneahmed Jan 25, 2026
d934167
:construction: Merge using tile outputs.
shaneahmed Jan 26, 2026
e660bb3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 26, 2026
be79c7f
[skip ci] :construction: Restructure dictionary output
shaneahmed Jan 26, 2026
55f7d7f
[skip ci] :construction: Fix structure of the output
shaneahmed Jan 26, 2026
7a2fb6c
[skip ci] :construction: Fix structure of the output
shaneahmed Jan 26, 2026
e63385d
Merge branch 'dev-define-engines-abc' into dev-define-multitask-segme…
shaneahmed Jan 28, 2026
189d5b3
:memo: Add docstring for `_get_inst_info_dicts`
shaneahmed Jan 29, 2026
13aa48c
:construction: Working on testing tile based output
shaneahmed Jan 29, 2026
44456a7
:construction: Finalise wsi_info_dict structure to work with save_pre…
shaneahmed Jan 29, 2026
4dbf9c4
:white_check_mark: Update hovernet postprocessing to be compatible wi…
shaneahmed Jan 29, 2026
eb60aa1
:construction: Initial implementation of merged predictions
shaneahmed Jan 30, 2026
820bb6e
:construction: Initial implementation of merged predictions
shaneahmed Jan 30, 2026
30c2ae7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 30, 2026
2c0dccd
:white_check_mark: Add support for tile based "predictions" output
shaneahmed Jan 30, 2026
c963514
:white_check_mark: Add support for tile based "predictions" output
shaneahmed Jan 30, 2026
0aaaf5b
:bug: Fix deepsource error
shaneahmed Jan 30, 2026
e3f9458
:bug: Fix deepsource error
shaneahmed Jan 30, 2026
f5fe072
:bug: Fix `mypy` error
shaneahmed Jan 30, 2026
4683416
:bug: Fix deepsource errors
shaneahmed Jan 30, 2026
af8b67b
:bug: Fix coverage for `misc.py`
shaneahmed Jan 30, 2026
5820182
:bug: Fix coverage for `multi_task_segmentor.py`
shaneahmed Jan 30, 2026
ce865bd
:memo: Update docstrings.
shaneahmed Jan 30, 2026
260bbc9
:memo: Update docstrings.
shaneahmed Jan 30, 2026
21b3398
:memo: Update docstrings.
shaneahmed Jan 30, 2026
c6b7d72
:memo: Update docstrings.
shaneahmed Jan 30, 2026
c2f0ac6
:memo: Update docstrings.
shaneahmed Jan 30, 2026
d8ed2f5
:pushpin: Pin `dask>=2026.1.2`
shaneahmed Jan 30, 2026
ccc7fd4
:white_check_mark: Add CLI support.
shaneahmed Jan 31, 2026
4ac2ef4
:white_check_mark: Update CLI tests.
shaneahmed Jan 31, 2026
1cbb01b
:bug: Fix ARG001 error
shaneahmed Jan 31, 2026
7801944
:bug: Fix deepsource and `mypy` errors.
shaneahmed Jan 31, 2026
60852ea
Merge branch 'dev-define-engines-abc' into dev-define-multitask-segme…
shaneahmed Jan 31, 2026
3cf8504
:green_heart: Address Co-Pilot review comments.
shaneahmed Feb 2, 2026
1e52eca
Merge branch 'dev-define-engines-abc' into dev-define-multitask-segme…
shaneahmed Feb 2, 2026
9ecddab
Merge branch 'dev-define-engines-abc' into dev-define-multitask-segme…
shaneahmed Feb 3, 2026
46eb4dc
:green_heart: Address Co-Pilot comments
shaneahmed Feb 3, 2026
a60b50f
:zap: Use `prepare_full_batch` from `semantic_segmentor`.
shaneahmed Feb 3, 2026
3a68f0a
:zap: Use `save_to_cache` from `semantic_segmentor`.
shaneahmed Feb 3, 2026
1836816
:zap: Use `max(vm.available, 1)` to calculate memory usage.
shaneahmed Feb 3, 2026
9fb9ea6
:zap: Use `merge_horizontal` from `semantic_segmentor`.
shaneahmed Feb 3, 2026
f7e35be
:bug: Fix saving and deletion of temp_zarr name.
shaneahmed Feb 3, 2026
dd3e5a5
:white_check_mark: Use `hovernet_original-kumar`
shaneahmed Feb 3, 2026
27d6161
:white_check_mark: Update `NucleusInstanceSegmentor`.
shaneahmed Feb 3, 2026
86111a6
:white_check_mark: Add tests for io_config.
shaneahmed Feb 3, 2026
de65370
:white_check_mark: Add `cli` for `nucleus_instance_segmentor`.
shaneahmed Feb 3, 2026
52e21e6
:white_check_mark: Add tests for cli
shaneahmed Feb 3, 2026
151b61e
:white_check_mark: Add tests for cli coverage.
shaneahmed Feb 3, 2026
6015d5f
:white_check_mark: Add progress bar for saving annotationstore.
shaneahmed Feb 4, 2026
a0ae9d1
:white_check_mark: Update ioconfig
shaneahmed Feb 4, 2026
f48c4e0
:white_check_mark: Update batchsize for cli and tests
shaneahmed Feb 4, 2026
e962fe5
:bug: Fix deepsource bug
shaneahmed Feb 4, 2026
73f7d61
:bug: Fix tests
shaneahmed Feb 5, 2026
aae3529
:lipstick: Update description for tqdm
shaneahmed Feb 5, 2026
322f4f6
:lipstick: Update description for tqdm
shaneahmed Feb 5, 2026
7c62b3d
:white_check_mark: Add tests for improved coverage
shaneahmed Feb 5, 2026
199aeb9
:zap: Use dask delayed for parallel post-processing.
shaneahmed Feb 5, 2026
f2df80d
📝 Update example nucleus-instance-segmentation notebook
gozdeg Feb 5, 2026
2a93636
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 5, 2026
20a2a84
:lipstick: Replace `tqdm.write` with `tqdm.desc`
shaneahmed Feb 6, 2026
63d9157
:bug: Fix failing test for DummyTQDM
shaneahmed Feb 6, 2026
9fda536
:zap: Use dask delayed to save annotations.
shaneahmed Feb 6, 2026
bbb1bbf
:lipstick: Add tqdm to creating list of tasks
shaneahmed Feb 6, 2026
2684d92
:lipstick: Update `warnings` and `tqdm`.
shaneahmed Feb 7, 2026
a1ee82d
:bug: Fix test with same input and output directory.
shaneahmed Feb 7, 2026
8318a14
:recycle: Restructure calculation of delayed objects
shaneahmed Feb 7, 2026
bcbfb1a
:zap: Pass only small arrays to delayed function
shaneahmed Feb 7, 2026
cbc27b9
:bug: Fix deep source error.
shaneahmed Feb 7, 2026
ae09e90
:lipstick: Update tqdm
shaneahmed Feb 7, 2026
6b320cd
:zap: Test computation of arrays using dask delayed.
shaneahmed Feb 7, 2026
eaa13af
:zap: Test computation of arrays using dask delayed.
shaneahmed Feb 7, 2026
199674c
:bug: Fix tqdm_loop
shaneahmed Feb 7, 2026
11513d6
:lipstick: Update tqdm loop engine_abc.py
shaneahmed Feb 7, 2026
ca55c74
:lipstick: Update tqdm loop semantic_segmentor.py
shaneahmed Feb 7, 2026
0ba7627
:lipstick: Update tqdm loop semantic_segmentor.py
shaneahmed Feb 7, 2026
9a03550
:lipstick: Use `get_tqdm_full` for nucleus_detector.py
shaneahmed Feb 7, 2026
1480c2c
:lipstick: Use `get_tqdm_full` for nucleus_detector.py
shaneahmed Feb 7, 2026
6fb8293
:bug: Fix `mypy` errors.
shaneahmed Feb 7, 2026
1fc69d7
:zap: Try computing full array
shaneahmed Feb 8, 2026
628cdd0
:lipstick: Use tqdm progress bar for dask
shaneahmed Feb 8, 2026
b7df2e0
:lipstick: Use tqdm.dask progress bar for dask
shaneahmed Feb 8, 2026
69fa82d
:bug: Fix delayed_tasks compute
shaneahmed Feb 8, 2026
0b91f28
:recycle: Add `tqdm_dask_progress_bar`
shaneahmed Feb 8, 2026
dba148f
:zap: Optimise performance and move tqdm progress bar to misc
shaneahmed Feb 9, 2026
af5d598
:zap: Tile based processing is faster
shaneahmed Feb 9, 2026
8741c93
:bug: Fix memory threshold variable.
shaneahmed Feb 9, 2026
3fd396b
:bug: Update appropriate tile_shape
shaneahmed Feb 9, 2026
239b434
:zap: Optimise by removing unnecessary dask compute
shaneahmed Feb 9, 2026
dcd7384
:bug: Fix outputs for annotationstore with multiple inputs.
shaneahmed Feb 9, 2026
bc86d74
:fire: Remove unnecessary variables
shaneahmed Feb 9, 2026
7dd658e
Merge branch 'dev-define-multitask-segmentor' into dev-update-noteboo…
shaneahmed Feb 10, 2026
5d26867
:bug: Fix writing annotations for large images
shaneahmed Feb 11, 2026
90e3fd5
:zap: Improve annotationstore writing
shaneahmed Feb 11, 2026
787c489
:bug: Fix output annotation type
shaneahmed Feb 11, 2026
bd28991
:zap: Use vectorized shapely.box instead of shapely.geometry.box
shaneahmed Feb 11, 2026
10e7ad7
Merge branch 'dev-define-multitask-segmentor' into dev-update-noteboo…
shaneahmed Feb 11, 2026
3a0468c
📝 Example Notebook-08 - Add TIAviz example & some minor edits
gozdeg Feb 11, 2026
09e9d73
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 11, 2026
476a365
:bulb: Address review comments
shaneahmed Feb 12, 2026
de2c899
:bug: Fix deepsource error
shaneahmed Feb 12, 2026
5137f6f
:lipstick: Set `leave=False` for tqdm loops
shaneahmed Feb 12, 2026
8a4d065
Merge branch 'dev-define-multitask-segmentor' into dev-update-noteboo…
shaneahmed Feb 12, 2026
1659191
:bug: Fix `pre-commit` errors
shaneahmed Feb 12, 2026
d26e1bc
:art: Improve structure of the notebook
shaneahmed Feb 12, 2026
28974cd
:art: Improve structure of the notebook
shaneahmed Feb 12, 2026
6e7597e
:bug: Fix multi-gpu run
shaneahmed Feb 12, 2026
f9acb74
Merge branch 'dev-define-multitask-segmentor' into dev-update-noteboo…
shaneahmed Feb 12, 2026
87bd1dc
:zap: Creating annotations from zarr array is slow
shaneahmed Feb 12, 2026
80a3b11
:bug: Fix zero output array
shaneahmed Feb 12, 2026
ba7f5d2
:zap: Convert to annotationstore from memory
shaneahmed Feb 12, 2026
bbc9a86
Merge branch 'dev-define-multitask-segmentor' into dev-update-noteboo…
shaneahmed Feb 12, 2026
9429067
🐛 Fix runtime IO config usage for tile post-processing
gozdeg Feb 13, 2026
892a08f
:bulb: Address review comments
shaneahmed Feb 13, 2026
1f0d0e0
Merge branch 'dev-define-engines-abc' into dev-define-multitask-segme…
shaneahmed Feb 13, 2026
9ae3d25
🐛Update ioconfig for baseline input_resolutions
gozdeg Feb 13, 2026
383f862
🐛 Fix model.class_dict usage for multi-gpu setting
gozdeg Feb 13, 2026
c6eec65
📝 Change download links to huggingface
gozdeg Feb 13, 2026
e1862eb
Merge branch 'dev-define-engines-abc' into dev-define-multitask-segme…
shaneahmed Feb 14, 2026
fb22efa
Merge branch 'dev-define-engines-abc' into dev-update-notebook-08
shaneahmed Feb 14, 2026
fb39268
Merge branch 'dev-define-engines-abc' into dev-define-multitask-segme…
shaneahmed Feb 16, 2026
f141549
:twisted_rightwards_arrows: Merge branch 'dev-define-engines-abc' int…
shaneahmed Feb 16, 2026
8d8b213
Merge branch 'dev-define-multitask-segmentor' into dev-update-noteboo…
shaneahmed Feb 16, 2026
bda1e4b
Merge branch 'dev-define-engines-abc' into dev-update-notebook-08
shaneahmed Feb 18, 2026
b00c846
:twisted_rightwards_arrows: Merge `dev-define-engines-abc` into `dev-…
shaneahmed Feb 18, 2026
2b13e02
🐛 pytest bug fix
gozdeg Feb 18, 2026
97a55d6
🐛 Fix multi-gpu support for all engines
gozdeg Feb 18, 2026
789ffa0
:bulb: Address Co-Pilot comments
shaneahmed Feb 19, 2026
7a0a99e
:bug: Revert typehints for mypy checks and update tests for multigpu …
shaneahmed Feb 19, 2026
eda3bac
:memo: Update 08-nucleus-instance-segmentation.ipynb
shaneahmed Feb 19, 2026
2be4e46
:memo: Update notebook `08-nucleus-instance-segmentation.ipynb`
shaneahmed Feb 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30,547 changes: 25,155 additions & 5,392 deletions examples/08-nucleus-instance-segmentation.ipynb

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions tests/engines/test_multi_task_segmentor.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def test_mtsegmentor_patches(remote_sample: Callable, track_tmp_path: Path) -> N
fields=fields,
expected_counts=expected_counts,
task_name=task_name,
class_dict=mtsegmentor.model.class_dict,
class_dict=mtsegmentor._get_model_attr("class_dict"),
)


Expand Down Expand Up @@ -252,6 +252,7 @@ def test_single_task_mtsegmentor(

assert len(output_ann) == 3

class_dict_ = mtsegmentor._get_model_attr("class_dict")
assert_annotation_store_patch_output(
inputs=inputs,
output_ann=output_ann,
Expand All @@ -260,7 +261,7 @@ def test_single_task_mtsegmentor(
fields=["box", "centroid", "contours", "prob", "type"],
expected_counts=expected_counts_nuclei,
task_name=None,
class_dict=mtsegmentor.model.class_dict["nuclei_segmentation"],
class_dict=class_dict_["nuclei_segmentation"],
)

zarr_file = track_tmp_path / "patch_output_annotationstore" / "output.zarr"
Expand Down Expand Up @@ -486,7 +487,7 @@ def test_wsi_segmentor_annotationstore(
verbose=False,
)

class_dict = mtsegmentor.model.class_dict
class_dict = mtsegmentor._get_model_attr("class_dict")

# Return Probabilities is False
output = mtsegmentor.run(
Expand Down
5 changes: 4 additions & 1 deletion tiatoolbox/models/engine/engine_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def save_predictions(
# scale_factor set from kwargs
scale_factor = kwargs.get("scale_factor", (1.0, 1.0))
# class_dict set from kwargs
class_dict = kwargs.get("class_dict", self.model.class_dict)
class_dict = kwargs.get("class_dict", self._get_model_attr("class_dict"))

return dict_to_store_patch_predictions(
processed_predictions,
Expand Down Expand Up @@ -1080,6 +1080,9 @@ def _update_ioconfig(
if stride_shape is not None:
ioconfig.stride_shape = stride_shape
if input_resolutions is not None:
Comment thread
shaneahmed marked this conversation as resolved.
for input_resolutions_ in input_resolutions:
if input_resolutions_["units"] == "baseline":
ioconfig = ioconfig.to_baseline()
ioconfig.input_resolutions = input_resolutions

return ioconfig
Expand Down
14 changes: 7 additions & 7 deletions tiatoolbox/models/engine/multi_task_segmentor.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ def post_process_wsi( # skipcq: PYL-R0201
"""
probabilities = raw_predictions["probabilities"]

tile_h, tile_w = self.ioconfig.tile_shape
tile_h, tile_w = self._ioconfig.tile_shape

trigger_tile_proc = any(
p.shape[0] > tile_h or p.shape[1] > tile_w for p in probabilities
Expand Down Expand Up @@ -1087,16 +1087,16 @@ def _process_tile_mode(
modified in this method; it only derives task-centric outputs.

"""
highest_input_resolution = self.ioconfig.highest_input_resolution
highest_input_resolution = self._ioconfig.highest_input_resolution
wsi_reader = self.dataloader.dataset.reader

# assume ioconfig has already been converted to `baseline` for `tile` mode
wsi_proc_shape = wsi_reader.slide_dimensions(**highest_input_resolution)

# * retrieve tile placement and tile info flag
# tile shape will always be corrected to be multiple of output
tile_info_sets = self._get_tile_info(wsi_proc_shape, self.ioconfig)
ioconfig = self.ioconfig.to_baseline()
tile_info_sets = self._get_tile_info(wsi_proc_shape, self._ioconfig)
ioconfig = self._ioconfig.to_baseline()

tile_metadata = _build_tile_tasks(
tile_info_sets=tile_info_sets,
Expand All @@ -1109,7 +1109,7 @@ def _process_tile_mode(
# Calculate batch size for dask compute
vm = psutil.virtual_memory()
bytes_per_element = np.dtype(probabilities[0].dtype).itemsize
tile_elements = np.prod(self.ioconfig.tile_shape)
tile_elements = np.prod(self._ioconfig.tile_shape)
prod_dim2 = math.prod(p.shape[2] for p in probabilities if len(p.shape) > 2) # noqa: PLR2004
tile_memory = len(probabilities) * tile_elements * prod_dim2 * bytes_per_element
# available memory
Expand Down Expand Up @@ -1625,7 +1625,7 @@ def _save_predictions_as_annotationstore(
# scale_factor set from kwargs
scale_factor = kwargs.get("scale_factor", (1.0, 1.0))
# class_dict set from kwargs
class_dict = kwargs.get("class_dict")
class_dict = kwargs.get("class_dict", self._get_model_attr("class_dict"))

# Need to add support for zarr conversion.
save_paths = []
Expand Down Expand Up @@ -1839,7 +1839,7 @@ def save_predictions(

# This runs dask.compute and returns numpy arrays
# for saving annotationstore output.
class_dict = kwargs.get("class_dict", self.model.class_dict)
class_dict = kwargs.get("class_dict", self._get_model_attr("class_dict"))
if len(self.tasks) == 1 and class_dict is not None:
kwargs["class_dict"] = class_dict[next(iter(self.tasks))]
else:
Expand Down
6 changes: 3 additions & 3 deletions tiatoolbox/models/engine/nucleus_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,10 @@ def post_process_wsi(
# min_distance and postproc_tile_shape cannot be None here
min_distance = kwargs.get("min_distance")
if min_distance is None:
min_distance = self.model.min_distance
min_distance = self._get_model_attr("min_distance")
postproc_tile_shape = kwargs.get("postproc_tile_shape")
if postproc_tile_shape is None:
postproc_tile_shape = self.model.postproc_tile_shape
postproc_tile_shape = self._get_model_attr("postproc_tile_shape")

# Add halo (overlap) around each block for post-processing
depth_h = min_distance
Expand Down Expand Up @@ -600,7 +600,7 @@ class names.
# class_dict set from kwargs
class_dict = kwargs.get("class_dict")
if class_dict is None:
class_dict = self.model.output_class_dict
class_dict = self._get_model_attr("output_class_dict")

out = self._save_predictions_annotation_store(
processed_predictions,
Expand Down
2 changes: 1 addition & 1 deletion tiatoolbox/models/engine/semantic_segmentor.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ def save_predictions(
# scale_factor set from kwargs
scale_factor = kwargs.get("scale_factor", (1.0, 1.0))
# class_dict set from kwargs
class_dict = kwargs.get("class_dict", self.model.class_dict)
class_dict = kwargs.get("class_dict", self._get_model_attr("class_dict"))

# Need to add support for zarr conversion.
save_paths = []
Expand Down