Skip to main content

vame.analysis.pose_segmentation

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

embedd_latent_vectors

def embedd_latent_vectors(
cfg: dict, files: List[str], model: RNN_VAE, fixed: bool,
tqdm_stream: TqdmToLogger | None) -> List[np.ndarray]

Embed latent vectors for the given files using the VAME model.

Arguments:

  • cfg dict - Configuration dictionary.
  • files List[str] - List of files names.
  • model RNN_VAE - VAME model.
  • fixed bool - Whether the model is fixed.
  • tqdm_stream TqdmToLogger - TQDM Stream to redirect the tqdm output to logger.

Returns:

  • List[np.ndarray] - List of latent vectors for each file.

get_motif_usage

def get_motif_usage(label: np.ndarray) -> np.ndarray

Compute motif usage from the label array.

Arguments:

  • label np.ndarray - Label array.

Returns:

  • np.ndarray - Array of motif usage counts.

same_parametrization

def same_parametrization(
cfg: dict, files: List[str], latent_vector_files: List[np.ndarray],
states: int, parametrization: str
) -> Tuple[List[np.ndarray], List[np.ndarray], List[np.ndarray]]

Apply the same parametrization to all animals.

Arguments:

  • cfg dict - Configuration dictionary.
  • files List[str] - List of file names.
  • latent_vector_files List[np.ndarray] - List of latent vector arrays.
  • states int - Number of states.
  • parametrization str - parametrization method.

Returns:

  • Tuple - Tuple of labels, cluster centers, and motif usages.

individual_parametrization

def individual_parametrization(cfg: dict, files: List[str],
latent_vector_files: List[np.ndarray],
cluster: int) -> Tuple

Apply individual parametrization to each animal.

Arguments:

  • cfg dict - Configuration dictionary.
  • files List[str] - List of file names.
  • latent_vector_files List[np.ndarray] - List of latent vector arrays.
  • cluster int - Number of clusters.

Returns:

  • Tuple - Tuple of labels, cluster centers, and motif usages.

pose_segmentation

@save_state(model=PoseSegmentationFunctionSchema)
def pose_segmentation(config: str, save_logs: bool = False) -> None

Perform pose segmentation using the VAME model.

Arguments:

  • config str - Path to the configuration file.

Returns:

None