tirank.Imageprocessing.infer_by_pretrain

tirank.Imageprocessing.infer_by_pretrain(images, pretrain_path)[source]

Generates feature embeddings from image tiles using the pre-trained CTransPath.

Parameters:
  • images (np.ndarray) – A stack of image tiles (n_spots, H, W, C).

  • pretrain_path (str) – Path to the CTransPath model’s .pth weights file.

Returns:

A tensor of feature embeddings of shape (n_spots, n_features).

Return type:

torch.Tensor