lazyslide.tl.feature_prediction#
- feature_prediction(wsi, model, feature_key=None, *, batch_size=1024, tile_key='tiles', key_added=None, amp=None, autocast_dtype=None, device=None, pbar=None)#
Predict tile-level values from an existing feature matrix.
- Parameters:
- wsi
WSIData The whole-slide image object containing tile features.
- modelstr or feature prediction model
A registered feature prediction model name or an object implementing
predict(features).- feature_keystr, optional
Feature table used as model input. When omitted, this is inferred from
model.features_model_name.- batch_sizeint, default: 1024
Number of tile feature vectors passed to the model at once.
- tile_keystr, default: “tiles”
Tile table associated with the input and output features.
- key_addedstr, optional
Key used to store the prediction table. Defaults to
{model_name}_{tile_key}.- ampbool, optional
Whether to use automatic mixed precision.
- autocast_dtypetorch.dtype, optional
Data type used for automatic mixed precision.
- devicestr, optional
Device on which to run inference.
- pbarbool, optional
Whether to display a progress bar.
- wsi
- Returns:
- None
Notes
Dense input matrices are passed to the model as basic row slices. NumPy therefore supplies views rather than copying the full feature vectors.