Dialogs for running training and/or inference in GUI.

class sleap.gui.learning.dialog.LearningDialog(mode: str, labels_filename: str, labels: Optional[] = None, skeleton: Optional[Skeleton] = None, *args, **kwargs)[source]

Dialog for running training and/or inference.

The dialog shows tabs for configuring the pipeline ( TrainingPipelineWidget) and, depending on the pipeline, for each specific model (TrainingEditorWidget).

In training mode, the model hyperpameters are editable unless you’re using a trained model; they are read-only in inference mode.

  • mode – either “training” or “inference”.

  • labels_filename – path to labels file, used for default location to save models.

  • labels – the Labels object (can also be loaded from given filename)

  • skeleton – the Skeleton object (can also be taken from Labels), used for list of nodes for (e.g.) selecting anchor node

property frame_selection

Returns dictionary with frames that user has selected for learning.


Run with current dialog settings.

class sleap.gui.learning.dialog.TrainingEditorWidget(video: Optional[] = None, skeleton: Optional[Skeleton] = None, head: Optional[str] = None, cfg_getter: Optional[TrainingConfigsGetter] = None, require_trained: bool = False, *args, **kwargs)[source]

Dialog for viewing and modifying training profiles (model hyperparameters).

  • videoVideo to use for receptive field preview

  • skeletonSkeleton to use for node option list

  • head – If given, then only show configs with specified head name

  • cfg_getter – Object to use for getting list of config files. If given, then menu of config files will be shown so user can either copy hyperameters from another profile/model, or use a model that was already trained.

  • require_trained – If True, then only show configs that are trained, and don’t allow user to uncheck “use trained” setting. This is set when LearningDialog is in “inference” mode.

class sleap.gui.learning.dialog.TrainingPipelineWidget(mode: str, skeleton: Optional[Skeleton] = None, *args, **kwargs)[source]

Widget used in LearningDialog for configuring pipeline.