Quick Start¶
Train a model and run inference in under 5 minutes.
Installation¶
See full installation guide for other methods and troubleshooting.
Prerequisites¶
- A training dataset (
.slpor.pkg.slpfile)
Step 1: Create a Config File¶
Create config.yaml:
config.yaml
data_config:
train_labels_path:
- train.pkg.slp
val_labels_path:
- val.pkg.slp
model_config:
backbone_config:
unet:
filters: 32
max_stride: 16
head_configs:
single_instance:
confmaps:
sigma: 5.0
trainer_config:
max_epochs: 50
save_ckpt: true
ckpt_dir: models
run_name: my_first_model
Or grab a sample config for your model type.
Step 2: Train¶
That's it! Training will:
- Load your data
- Build the model
- Train for 50 epochs
- Save the best checkpoint to
models/my_first_model/
Step 3: Run Inference¶
sleap-nn predict --data_path val.pkg.slp --model_paths models/my_first_model/ -o val.predictions.slp
This creates val.predictions.slp with your predictions.
Step 4: View Results¶
Open the predictions in the SLEAP GUI:
Or load in Python:
import sleap_io as sio
labels = sio.load_slp("val.predictions.slp")
print(f"Found {len(labels)} frames with predictions")
What's Next?¶
-
Train a multi-animal model
-
Customize your config
-
Enable tracking
-
Export for production