sleap.gui.learning.dialog¶
Dialogs for running training and/or inference in GUI.
-
class
sleap.gui.learning.dialog.
LearningDialog
(mode: str, labels_filename: str, labels: Optional[sleap.io.dataset.Labels] = 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.
- Parameters
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.
-
class
sleap.gui.learning.dialog.
TrainingEditorWidget
(video: Optional[sleap.io.video.Video] = 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).
- Parameters
video – Video to use for receptive field preview
skeleton – Skeleton 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.