plismbench.models.mahmood_lab module#

Models from Mahmood Lab.

class plismbench.models.mahmood_lab.UNI(device: int | list[int] | None = -1, mixed_precision: bool = False)[source]#

Bases: Extractor

UNI model developped by Mahmood Lab available on Hugging-Face (1).

Parameters:
  • device (int | list[int] | None = DEFAULT_DEVICE,) – Compute resources to use. If None, will use all available GPUs. If -1, extraction will run on CPU.

  • mixed_precision (bool = True) – Whether to use mixed_precision.

property transform: Compose#

Transform method to apply element wise.

class plismbench.models.mahmood_lab.UNI2h(device: int | list[int] | None = -1, mixed_precision: bool = False)[source]#

Bases: Extractor

UNI2-h model developped by Mahmood Lab available on Hugging-Face (1).

Parameters:
  • device (int | list[int] | None = DEFAULT_DEVICE,) – Compute resources to use. If None, will use all available GPUs. If -1, extraction will run on CPU.

  • mixed_precision (bool = True) – Whether to use mixed_precision.

property transform: Compose#

Transform method to apply element wise.

class plismbench.models.mahmood_lab.CONCH(device: int | list[int] | None = -1, mixed_precision: bool = False)[source]#

Bases: Extractor

CONCH model developped by Mahmood Lab available on Hugging-Face (1).

Parameters:
  • device (int | list[int] | None = DEFAULT_DEVICE,) – Compute resources to use. If None, will use all available GPUs. If -1, extraction will run on CPU.

  • mixed_precision (bool = True) – Whether to use mixed_precision.

process(image) Tensor[source]#

Process input images.

property transform: Lambda#

Transform method to apply element wise.

class plismbench.models.mahmood_lab.CONCHv15(device: int | list[int] | None = -1, mixed_precision: bool = False)[source]#

Bases: Extractor

Conchv15 model available from TITAN on Hugging-Face (1).

property transform: Lambda#

Transform method to apply element wise.