Skip to content

Sample Configs

Ready-to-use configuration templates for common scenarios.


By Model Type

Single Instance

One animal per frame.

Config Backbone Receptive Field
single_instance_unet_medium UNet Medium
single_instance_unet_large UNet Large

Top-Down

Two-stage: centroid detection + pose estimation.

Config Backbone Notes
centroid_unet UNet Stage 1
centroid_swint Swin-T Stage 1
centered_instance_unet_medium UNet Stage 2, Medium
centered_instance_unet_large UNet Stage 2, Large

Centroid-Only (points)

First-class single-stage "animals-as-points" model: one centroid per animal, no per-keypoint pose. This is a standalone centroid model — distinct from the top-down stage-1 centroid configs above, which are paired with a centered-instance model and trained on downscaled crops. Trains at full resolution; inference collapses to a single-node 'centroid' skeleton. See the Centroid-Only Inference guide.

Config Backbone Notes
centroid_unet_standalone UNet Standalone, full-res, NOT top-down stage-1

Bottom-Up

Single-stage multi-instance.

Config Backbone Receptive Field
bottomup_unet_medium UNet Medium
bottomup_unet_large UNet Large
bottomup_convnext ConvNeXt -

Multi-Class (Identity)

With supervised identity tracking.

Config Model Type Backbone
multi_class_bottomup Bottom-Up UNet
multi_class_topdown Top-Down UNet

Segmentation (masks)

Single-stage bottom-up instance segmentation (per-instance masks instead of keypoints). fg_threshold / min_mask_area are inference-time args; train at scale: 1.0.

Config Backbone Notes
bottomup_segmentation_unet UNet Foreground + center + offsets heads
bottomup_segmentation_pretrained Pretrained (HuggingFace ConvNeXtV2) Reuse an external pretrained encoder; see the Pretrained Backbones guide

Quick Start Templates

Minimal Single Instance

data_config:
  train_labels_path:
    - train.slp

model_config:
  backbone_config:
    unet:
      filters: 32
      max_stride: 16
  head_configs:
    single_instance:
      confmaps:
        sigma: 5.0

trainer_config:
  max_epochs: 100
  save_ckpt: true
  ckpt_dir: models
  run_name: single_instance

Minimal Bottom-Up

data_config:
  train_labels_path:
    - train.slp

model_config:
  backbone_config:
    unet:
      filters: 32
      max_stride: 32
      output_stride: 4
  head_configs:
    bottomup:
      confmaps:
        sigma: 2.5
        output_stride: 4
      pafs:
        sigma: 75.0
        output_stride: 8

trainer_config:
  max_epochs: 200
  save_ckpt: true
  ckpt_dir: models
  run_name: bottomup

Minimal Top-Down (Centroid)

data_config:
  train_labels_path:
    - train.slp

model_config:
  backbone_config:
    unet:
      filters: 32
      max_stride: 16
  head_configs:
    centroid:
      confmaps:
        sigma: 5.0

trainer_config:
  max_epochs: 100
  save_ckpt: true
  ckpt_dir: models
  run_name: centroid

Minimal Top-Down (Instance)

data_config:
  train_labels_path:
    - train.slp
  preprocessing:
    crop_size: 256

model_config:
  backbone_config:
    unet:
      filters: 32
      max_stride: 16
  head_configs:
    centered_instance:
      confmaps:
        sigma: 5.0

trainer_config:
  max_epochs: 100
  save_ckpt: true
  ckpt_dir: models
  run_name: centered_instance

Download All Samples

# Clone the repo
git clone https://github.com/talmolab/sleap-nn.git

# Configs are in docs/sample_configs/
ls sleap-nn/docs/sample_configs/

Customize a Sample

  1. Download a sample config
  2. Update train_labels_path and val_labels_path
  3. Adjust ckpt_dir and run_name
  4. Run training:
sleap-nn train --config my_config.yaml

Tips

Start with medium receptive field

Medium RF configs are a good balance of speed and accuracy.

Use augmentation

All sample configs have augmentation enabled. Disable with use_augmentations_train: false for debugging.

Check your data first

Open your .slp file in SLEAP to verify labels before training.