sleap.gui.suggestions¶
Module for generating lists of suggested frames (for labeling or reviewing).
-
class
sleap.gui.suggestions.
SuggestionFrame
(video: sleap.io.video.Video, frame_idx: int, group: Optional[int] = None)[source]¶ Object for storing a single suggested frame item.
-
class
sleap.gui.suggestions.
VideoFrameSuggestions
[source]¶ Class for generating lists of suggested frames.
Implements various algorithms as methods: * sample (either random or evenly spaced sample frames from each video) * image features (raw images/brisk -> pca -> k-means) * prediction_score (frames with number of instances below specified score)
Each of algorithm method should accept labels; other parameters will be passed from the params dict given to
suggest()
.-
classmethod
basic_sample_suggestion_method
(labels, per_video: int = 20, sampling_method: str = 'random', **kwargs)[source]¶ Method to generate suggestions by taking strides through video.
-
classmethod
image_feature_based_method
(labels, per_video, sample_method, scale, merge_video_features, feature_type, pca_components, n_clusters, per_cluster, **kwargs)[source]¶ Method to generate suggestions based on image features.
This is a wrapper for feature_suggestion_pipeline implemented in sleap.info.feature_suggestions.
-
classmethod
prediction_score
(labels: Labels, score_limit, instance_limit, **kwargs)[source]¶ Method to generate suggestions for proofreading frames with low score.
-
classmethod
suggest
(params: dict, labels: Labels = None) → List[sleap.gui.suggestions.SuggestionFrame][source]¶ This is the main entry point for generating lists of suggested frames.
- Parameters
params – A dictionary with all params to control how we generate suggestions, minimally this will have a “method” key with the name of one of the class methods.
labels – A Labels object for which we are generating suggestions.
- Returns
List of SuggestionFrame objects.
-
classmethod