loki.annotate.annotate_with_marker_genes
- loki.annotate.annotate_with_marker_genes(classes, image_embeddings, all_text_embeddings)
Annotates tissue image with similarity scores between image features and marker gene features.
- Parameters:
classes – A list or array of tissue type labels.
image_embeddings – A numpy array or torch tensor of image embeddings (shape: [n_images, embedding_dim]).
all_text_embeddings – A numpy array or torch tensor of text embeddings of the marker genes (shape: [n_classes, embedding_dim]).
- Returns:
dot_similarity: The matrix of dot product similarities between image embeddings and text embeddings.
pred_class: The predicted tissue type for the image based on the highest similarity score.