inference
sleap_nn.inference
¶
Inference-related modules.
Quick start::
from sleap_nn.inference import predict, Predictor
# One-liner: source + model paths → Labels
labels = predict("video.mp4", model_paths=["/path/to/model"])
# Two-step: build once, predict many times with different settings
predictor = Predictor.from_model_paths(["/path/to/model"], device="cuda")
labels = predictor.predict("video.mp4", peak_threshold=0.3)
Modules:
| Name | Description |
|---|---|
bottomup |
Inference modules for BottomUp models. |
centroid_convert |
Conversion helpers for centroid-only output representation. |
filters |
Post-inference filtering: |
identity |
Backward-compatibility re-export shim for identity ops. |
layers |
Inference layers — model-type-aware wrappers around a runtime backend. |
loaders |
Standalone checkpoint loading for the inference pipeline. |
ops |
Pure-ops library for inference (PR 1 of #508). |
outputs |
|
paf_grouping |
Backward-compatibility re-export shim for PAF grouping. |
peak_finding |
Backward-compatibility re-export shim for peak finding. |
postprocessing |
Backward-compatibility re-export shim for post-inference filters. |
predictor |
|
predictors |
Predictors for running inference. |
preprocess_info |
|
provenance |
Provenance metadata utilities for inference outputs. |
providers |
|
run |
Top-level |
sam |
SAM-powered prompted instance segmentation for INFERENCE. |
segmentation |
Inference utilities for bottom-up instance segmentation. |
segmentation_convert |
sleap-nn <-> sleap-io conversion helpers for instance segmentation masks. |
single_instance |
Inference modules for SingleInstance models. |
streaming |
Streaming primitives for the new inference stack. |
tile_merger |
Torch-native tiled inference: importance windows + accumulate/normalize canvas. |
topdown |
Inference modules for TopDown centroid and centered-instance models. |
tracking |
Tracking integration for the new |
utils |
Miscellaneous utility functions for Inference modules. |
writer |
|