Skip to main content

vame.util.gif_pose_helper

Variational Animal Motion Embedding 1.0-alpha Toolbox © K. Luxem & P. Bauer, Department of Cellular Neuroscience Leibniz Institute for Neurobiology, Magdeburg, Germany

https://github.com/LINCellularNeuroscience/VAME Licensed under GNU General Public License v3.0

get_animal_frames

def get_animal_frames(
cfg: dict,
filename: str,
pose_ref_index: list,
start: int,
length: int,
subtract_background: bool,
file_format: str = '.mp4',
crop_size: tuple = (300, 300)) -> list

Extracts frames of an animal from a video file and returns them as a list.

Arguments:

  • cfg dict - Configuration dictionary containing project information.
  • filename str - Name of the video file.
  • pose_ref_index list - List of reference coordinate indices for alignment.
  • start int - Starting frame index.
  • length int - Number of frames to extract.
  • subtract_background bool - Whether to subtract background or not.
  • file_format str, optional - Format of the video file. Defaults to '.mp4'.
  • crop_size tuple, optional - Size of the cropped area. Defaults to (300, 300).

Returns:

  • list - List of extracted frames.