Skip to content

ldctbench.hub.load_model

load_model(method, eval=True, device=None)

Load a pretrained model

Parameters:

  • method (Union[Literal[RESNET, CNN10, DUGAN, QAE, REDCNN, TRANSCT, WGANVGG, BILATERAL], str]) –

    Enum item or string, specifying model to load. See ldctbench.hub.methods.Methods for more info.

  • eval (bool, default: True ) –

    Return network in eval mode, by default True

  • device (Optional[device], default: None ) –

Returns:

  • Module

    The pretrained model

Examples:

Load a pretrained resnet model for LDCT denoising:

>>> from ldctbench.hub import load_model, Methods
>>> net = load_model(Methods.RESNET)  # is the same as load_model("resnet")