deepof.visuals.export_annotated_video
- deepof.visuals.export_annotated_video(coordinates: deepof_coordinates, soft_counts: dict | None = None, supervised_annotations: deepof_table_dict | None = None, bin_size: int | str | None = None, bin_index: int | str | None = None, precomputed_bins: ndarray | None = None, frame_limit_per_video: int | None = None, roi_number: int | None = None, animals_in_roi: list | None = None, roi_mode: str = 'mousewise', in_roi_criterion: str = 'Center', behaviors: list | None = None, experiment_id: str | None = None, min_confidence: float = 0.75, min_bout_duration: int | None = None, display_time: bool = False, display_counter: bool = False, display_arena: bool = False, display_markers: bool = False, display_mouse_labels: bool = False, exp_conditions: dict = {}, cluster_names: str | None = None)
Export annotated videos from both supervised and unsupervised pipelines.
- Parameters:
coordinates (coordinates) – coordinates object for the current project. Used to get video paths.
soft_counts (dict) – dictionary with soft_counts per experiment.
supervised_annotations (table_dict) – table dict with supervised annotations per experiment.
bin_size (Union[int,str]) – bin size for time filtering.
bin_index (Union[int,str]) – index of the bin of size bin_size to select along the time dimension. Denotes exact start position in the time domain if given as string.
precomputed_bins (np.ndarray) – precomputed time bins. If provided, bin_size and bin_index are ignored.
frame_limit_per_video (int) – number of frames to render per video. If None, all frames are included for all videos.
roi_number (int) – Number of the ROI that should be used for the plot (all behavior that occurs outside of the ROI gets excluded)
animals_in_roi (list) – List of ids of the animals that need to be inside of the active ROI. All frames in which any of the given animals are not inside of the ROI get excluded
roi_mode (str) – Determines how the rois should be applied to different behaviors. Options are “mousewise” (default, selected mice needs to be inside the ROI) and “behaviorwise” (only mice involved in a behavior need to be inside of the ROI, only for supervised behaviors)
in_roi_criterion (str) – Criterion for in roi check, can be a single bodypart, a list of bodyparts or “all” bodyparts of a mouse
behaviors (list) – Behaviors or Clusters to that get exported. If none is given, all are exported for softcounts and only nose2nose is exported for supervised annotations. If multiple behaviors are given as a list, one video can get annotated with multiple different behaviors
experiment_id (str) – if provided, data coming from a particular experiment is used. If not, all experiments are exported.
min_confidence (float) – minimum confidence threshold for a frame to be considered part of a cluster.
min_bout_duration (int) – Minimum number of frames to render a cluster assignment bout.
display_time (bool) – Displays current time in top left corner of the video frame
display_counter (bool) – Displays event counter for each displayed event.
display_arena (bool) – Displays arena for each video.
display_markers (bool) – Displays mouse body parts on top of the mice.
display_mouse_labels (bool) – Displays identities of the mice
exp_conditions (dict) – if provided, data coming from a particular condition is used. If not, all conditions are exported. If a dictionary with more than one entry is provided, the intersection of all conditions (i.e. male, stressed) is used.
cluster_names (dict) – dictionary with user-defined names for each cluster (useful to output interpretation).