callcut.pipeline.predict_recordings🔗

callcut.pipeline.predict_recordings(model, extractor, audio_paths, decoder, *, hop_frames=None)[source]🔗

Run inference on recordings and decode to call intervals.

For each recording: loads audio, extracts features, predicts frame-level probabilities, and decodes to call intervals. No ground truth annotations are needed.

Parameters:
modelBaseDetector

Trained model for call detection. Should already be on the desired device.

extractorBaseExtractor

Feature extractor matching the model’s expected input.

audio_pathslist of Path | str

Paths to audio files to process.

decoderBaseDecoder

Decoder for converting probabilities to call intervals.

hop_framesint | None

Hop between inference windows in frames. If None, uses the model’s default (75%% overlap).

Returns:
predictionslist of RecordingPrediction

Predicted call intervals for each recording.

Examples

>>> from callcut.pipeline import load_pipeline, predict_recordings
>>>
>>> model, extractor, decoder = load_pipeline("pipeline.pt")
>>> predictions = predict_recordings(model, extractor, audio_files, decoder)
>>> for pred in predictions:
...     print(f"{pred.audio_path.name}: {len(pred.intervals)} calls")