histocartography.ml.models.hovernet module

Summary

Classes:

BNReLU

Conv2dWithActivation

Decoder

DenseBlock

Encoder

HoverNet

ResidualBlock

SamepaddingLayer

Same padding layer.

Upsample2x

Functions:

crop_op

Center crop image.

class HoverNet[source]

Bases: torch.nn.modules.module.Module

__init__()[source]

HoverNet PyTorch re-implementation based: HoVer-Net: Simultaneous Segmentation and Classification of Nuclei in Multi-Tissue Histology Images.

forward(images)[source]

Forward pass.

class Encoder[source]

Bases: torch.nn.modules.module.Module

__init__()[source]

Encoder.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class SamepaddingLayer(ksize, stride)[source]

Bases: torch.nn.modules.module.Module

Same padding layer. Equivalent to TF padding=same conv.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class ResidualBlock(ch_in, ch, ksize, count, split=1, strides=1)[source]

Bases: torch.nn.modules.module.Module

__init__(ch_in, ch, ksize, count, split=1, strides=1)[source]

Residual Block.

forward(in_feats)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class Upsample2x[source]

Bases: torch.nn.modules.module.Module

__init__()[source]

Usampling input by 2x.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class Decoder[source]

Bases: torch.nn.modules.module.Module

__init__()[source]

Decoder.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class DenseBlock(ch_in, ch, ksize, count, split=1)[source]

Bases: torch.nn.modules.module.Module

__init__(ch_in, ch, ksize, count, split=1)[source]

DenseBlock.

forward(l)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class BNReLU(num_features)[source]

Bases: torch.nn.modules.module.Module

__init__(num_features)[source]

BNReLU.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class Conv2dWithActivation(num_input, num_output, filter_size, stride=1, activation=None, padding=0, bias=False, split=1)[source]

Bases: torch.nn.modules.module.Module

__init__(num_input, num_output, filter_size, stride=1, activation=None, padding=0, bias=False, split=1)[source]

Conv2dWithActivation.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

crop_op(x, cropping)[source]

Center crop image.

Reference

If you use histocartography in your projects, please cite the following:

@inproceedings{pati2021,
    title = {Hierarchical Graph Representations for Digital Pathology},
    author = {Pushpak Pati, Guillaume Jaume, Antonio Foncubierta, Florinda Feroce, Anna Maria Anniciello, Giosuè Scognamiglio, Nadia Brancati, Maryse Fiche, Estelle Dubruc, Daniel Riccio, Maurizio Di Bonito, Giuseppe De Pietro, Gerardo Botti, Jean-Philippe Thiran, Maria Frucci, Orcun Goksel, Maria Gabrani},
    booktitle = {https://arxiv.org/pdf/2102.11057},
    year = {2021}
}