sleap.info.summary#

Module for getting a series which gives some statistic based on labeling data for each frame of some labeled video.

class sleap.info.summary.StatisticSeries(labels: Labels)[source]#

Class to calculate various statistical series for labeled frames.

Each method returns a series which is a dictionary in which keys are frame index and value are some numerical value for the frame.

Parameters:

labels – The Labels for which to calculate series.

get_instance_score_series(video, reduction='sum') Dict[int, float][source]#

Get series with statistic of instance scores in each frame.

Parameters:
  • video – The Video for which to calculate statistic.

  • reduction – name of function applied to scores: * sum * min

Returns:

The series dictionary (see class docs for details)

get_point_count_series(video: Video) Dict[int, float][source]#

Get series with total number of labeled points in each frame.

get_point_displacement_series(video, reduction='sum') Dict[int, float][source]#

Get series with statistic of point displacement in each frame.

Point displacement is the distance between the point location in frame and the location of the corresponding point (same node, same track) from the closest earlier labeled frame.

Parameters:
  • video – The Video for which to calculate statistic.

  • reduction – name of function applied to point scores: * sum * mean * max

Returns:

The series dictionary (see class docs for details)

get_point_score_series(video: Video, reduction: str = 'sum') Dict[int, float][source]#

Get series with statistic of point scores in each frame.

Parameters:
  • video – The Video for which to calculate statistic.

  • reduction – name of function applied to scores: * sum * min

Returns:

The series dictionary (see class docs for details)

get_primary_point_displacement_series(video, reduction='sum', primary_node=None)[source]#

Get sum of displacement for single node of each instance per frame.

Parameters:
  • video – The Video for which to calculate statistic.

  • reduction – name of function applied to point scores: * sum * mean * max

  • primary_node – The node for which we’ll calculate displacement. This can be name of node or Node object. If not specified, then defaults to first node.

Returns:

The series dictionary (see class docs for details)

get_tracking_score_series(video: Video, reduction: str = 'min') Dict[int, float][source]#

Get series with statistic of tracking scores in each frame.

Parameters:
  • video – The Video for which to calculate statistic.

  • reduction – name of function applied to scores: * mean * min

Returns:

The series dictionary (see class docs for details)