Skip to content

Commit 280d65b

Browse files
committed
deepsource fixes
1 parent 16ba015 commit 280d65b

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

  • tiatoolbox/models/architecture/cerberus

tiatoolbox/models/architecture/cerberus/model.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ def __init__(
4444
lumen_type_dict: dict | None = None,
4545
) -> None:
4646
"""Initialize the fixed Cerberus ResNet-34 model."""
47-
nn.Module.__init__(self)
48-
self._postproc = self.postproc
49-
self._preproc = self.preproc
50-
self.class_dict = None
47+
ModelABC.__init__(self)
5148
NetDesc.__init__(self)
5249
self.patch_output_shape = tuple(patch_output_shape)
5350
self.tasks = ("nuclei", "gland", "lumen")
@@ -67,7 +64,7 @@ def __init__(
6764
"lumen": lumen_type_dict or {0: "Background", 1: "Lumen"},
6865
}
6966

70-
def forward(
67+
def forward( # skipcq: PYL-W0221
7168
self, imgs: torch.Tensor, train_decoder_list: list[str] | None = None
7269
) -> OrderedDict:
7370
"""Forward pass through the shared encoder and selected Cerberus decoders."""
@@ -135,6 +132,7 @@ def infer_batch(
135132

136133
return tuple(outputs)
137134

135+
# skipcq: PYL-W0221 # noqa: ERA001
138136
def postproc(
139137
self, raw_maps: list[np.ndarray | da.Array], offset: tuple[int, int] = (0, 0)
140138
) -> tuple[dict, ...]:

0 commit comments

Comments
 (0)