lazyslide.tl.slide_caption#
- slide_caption(wsi, prompt, feature_key, *, agg_key=None, agg_by=None, max_length=100, model='prism', device=None)#
Generate captions for the slide.
- Parameters:
- wsi
WSIData The WSIData object to work on.
- promptlist of str
The text instruction to generate the caption.
- feature_keystr
The slide features to be used.
- agg_keystr, default: None
The aggregation key.
- agg_bystr or list of str, default: None
The aggregation keys that were used to create the slide features.
- max_lengthint, default: 100
The maximum length of the generated caption.
- model{“prism”}, default: “prism”
The caption generation model to use.
- devicestr, default: None
The device to use for inference. If None, the default device will be used.
- wsi
- Returns:
DataFrameThe generated captions. Contains a ‘caption’ column, plus any annotation columns if aggregation groups were used.