Skip to content

Example Notebooks

Interactive tutorials using marimo notebooks.


Accessing Notebooks

The example notebooks are in the sleap-nn GitHub repository in the example_notebooks/ folder. They use marimo which provides a sandboxed environment that automatically handles all dependencies.


Prerequisites

Install uv:

# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Available Notebooks

Download notebooks from here.

Training Demo

Open in molab

End-to-end top-down demo: build the centroid + centered-instance configs (saved to YAML), train on the flies13 dataset, evaluate on the test split, then run tracked inference on a clip and render it with sio.render_video. Open it on molab (enable the GPU from the notebook-specs button) or run locally:

uvx marimo edit --sandbox training_demo.py

Augmentation Guide

Visualize different data augmentation techniques available in sleap-nn.

uvx marimo edit --sandbox augmentation_guide.py

Receptive Field Guide

Visualize how receptive field changes with different config parameters.

uvx marimo edit --sandbox receptive_field_guide.py

Running Notebooks

Each notebook runs in a sandboxed environment - no need to install sleap-nn separately:

# Navigate to your notebooks folder
cd example_notebooks/

# Run any notebook
uvx marimo edit --sandbox <notebook_name>.py

The --sandbox flag creates an isolated environment with all required dependencies.