Skip to content

Commit 5c5bfc4

Browse files
committed
fix error
1 parent 8a7295d commit 5c5bfc4

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

tiatoolbox/models/architecture/grandqc.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ def preproc(image: np.ndarray) -> np.ndarray:
6464

6565
@staticmethod
6666
def postproc(image: np.ndarray) -> np.ndarray:
67-
"""Define post-processing of this class of model.
67+
"""Define post-processing for this model.
6868
69-
This simply applies argmin along last axis of the input.
69+
This returns the class index with the minimum probability.
70+
In this model, this means selecting tissue class.
7071
7172
"""
7273
return image.argmin(axis=-1)
@@ -91,15 +92,6 @@ def infer_batch(
9192
9293
This contains logic for forward operation as well as i/o
9394
94-
Args:
95-
model (nn.Module):
96-
PyTorch defined model.
97-
batch_data (:class:`torch.Tensor`):
98-
A batch of data generated by
99-
`torch.utils.data.DataLoader`.
100-
device (str):
101-
Transfers model to the specified device. Default is "cpu".
102-
10395
Args:
10496
model (nn.Module):
10597
PyTorch defined model.

tiatoolbox/wsicore/wsireader.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,11 +1572,7 @@ def tissue_mask(
15721572
)
15731573
elif method == "otsu":
15741574
masker = tissuemask.OtsuTissueMasker(**masker_kwargs)
1575-
else: # grandqc
1576-
masker = tissuemask.GrandQCMasker(**masker_kwargs)
1577-
# GrandQC model is trained on 10mpp images
1578-
thumbnail = self.slide_thumbnail(resolution=10, units="mpp")
1579-
mask_img = masker.fit_transform(np.array([thumbnail]))[0]
1575+
mask_img = masker.fit_transform([thumbnail])[0]
15801576
return VirtualWSIReader(mask_img.astype(np.uint8), info=self.info, mode="bool")
15811577

15821578
def save_tiles(

0 commit comments

Comments
 (0)