callcut.pipeline.load_pipeline๐
- callcut.pipeline.load_pipeline(fname, *, device=None)[source]๐
Load a complete pipeline from a file.
Reconstructs the model (with trained weights), feature extractor, and decoder from a file saved with
save_pipeline().- Parameters:
- fname
str|Path Path to the saved pipeline file.
- device
str|torch.device|None Device to load the model to (e.g.,
"cpu","cuda:0","mps"). IfNone, uses the default torch device.
- fname
- Returns:
- model
BaseDetector The trained model with loaded weights.
- extractor
BaseExtractor Feature extractor matching the modelโs expected input.
- decoder
BaseDecoder Decoder for converting probabilities to intervals.
- model
See also
save_pipelineSave a pipeline to a file.
Examples
>>> from callcut.pipeline import load_pipeline >>> >>> model, extractor, decoder = load_pipeline("pipeline.pt", device="cpu")