deepof.visuals.animate_skeleton

deepof.visuals.animate_skeleton(coordinates: deepof_coordinates, experiment_id: str, animal_id: list | None = None, center: str = 'arena', align: str | None = None, frame_limit: int | None = None, min_confidence: float = 0.0, min_bout_duration: int | None = None, cluster_assignments: ndarray | None = None, embedding: List | ndarray | None = None, selected_cluster: ndarray | None = None, display_arena: bool = True, legend: bool = True, save: bool | None = None, dpi: int = 300)

Render a FuncAnimation object with embeddings and/or motion trajectories over time.

Parameters:
  • coordinates (coordinates) – deepof Coordinates object.

  • experiment_id (str) – Name of the experiment to display.

  • animal_id (list) – ID list of animals to display. If None (default) it shows all animals.

  • center (str) – Name of the body part to which the positions will be centered. If false, the raw data is returned; if ‘arena’ (default), coordinates are centered in the pitch.

  • align (str) – Selects the body part to which later processes will align the frames with (see preprocess in table_dict documentation).

  • frame_limit (int) – Number of frames to plot. If None, the entire video is rendered.

  • min_confidence (float) – Minimum confidence threshold to render a cluster assignment bout.

  • min_bout_duration (int) – Minimum number of frames to render a cluster assignment bout.

  • cluster_assignments (np.ndarray) – contain sorted cluster assignments for all instances in data. If provided together with selected_cluster, only instances of the specified component are returned. Defaults to None.

  • embedding (Union[List, np.ndarray]) – UMAP 2D embedding of the datapoints provided. If not None, a second animation shows a parallel animation with the currently selected embedding, colored by cluster if cluster_assignments are available.

  • selected_cluster (int) – cluster to filter. If provided together with cluster_assignments,

  • display_arena (bool) – whether to plot a dashed line with an overlying arena perimeter. Defaults to True.

  • legend (bool) – whether to add a color-coded legend to multi-animal plots. Defaults to True when there are more than one animal in the representation, False otherwise.

  • save (str) – name of the file where to save the produced animation.

  • dpi (int) – dots per inch of the figure to create.