Skip to content

Example Notebooks

This page provides information on how to access and use the example notebooks from the sleap-nn GitHub repository.

Accessing Example Notebooks

The example notebooks are available in the sleap-nn GitHub repository in the example_notebooks/ folder. These notebooks are created with marimo and provide interactive tutorials for various sleap-nn workflows.

Getting Started with Marimo

The example notebooks use marimo, which provides a sandboxed environment that automatically handles all dependencies. You don't need to create a separate sleap-nn environment.

Prerequisites

Install uv:

First Time Setup

Install uv first - a fast Python package manager:

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

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

Setup

Step-1 : Add marimo to your project

Ensure the working directory where you run uv init doesn't have an existing pyproject.toml as uv add will try to add marimo to the existing .toml.

# move to a new dir
mkdir sleap_nn_notebooks
cd sleap_nn_notebooks

# initialize uv
uv init

# Install marimo
uv add marimo

Step-2 : Run the marimo notebooks

Download the notebooks from here and ensure the python scripts are in your current working directory!

(i) Training Demo Notebook

  • Description: End-to-end demo on creating config files and running training, inference, and evaluation using sleap-nn APIs.
   uvx marimo edit --sandbox training_demo.py

(ii) Augmentation Guide Notebook

  • Description: Visualize the different data augmentation techniques available in sleap-nn.
   uvx marimo edit --sandbox augmentation_guide.py

(iii) Receptive Field Guide Notebook

  • Description: Visualize how the receptive field could be set by changing the config parameters.
   uvx marimo edit --sandbox receptive_field_guide.py