deepof.model_utils.embedding_per_video

deepof.model_utils.embedding_per_video(coordinates: deepof_coordinates, to_preprocess: deepof_table_dict, model: Model, scale: str = 'standard', animal_id: str | None = None, ruptures: bool = False, global_scaler: Any | None = None, **kwargs)

Use a previously trained model to produce embeddings, soft_counts and breaks per experiment in table_dict format.

Parameters:
  • coordinates (coordinates) – deepof.Coordinates object for the project at hand.

  • to_preprocess (table_dict) – dictionary with (merged) features to process.

  • scale (str) – The type of scaler to use within animals. Defaults to ‘standard’, but can be changed to ‘minmax’, ‘robust’, or False. Use the same that was used when training the original model.

  • animal_id (str) – if more than one animal is present, provide the ID(s) of the animal(s) to include.

  • ruptures (bool) – Whether to compute the breaks based on ruptures (with the length of all retrieved chunks per experiment) or not (an all-ones vector per experiment is returned).

  • global_scaler (Any) – trained global scaler produced when processing the original dataset.

  • model (tf.keras.models.Model) – trained deepof unsupervised model to run inference with.

  • **kwargs – additional arguments to pass to coordinates.get_graph_dataset().

Returns:

embeddings per experiment. soft_counts (table_dict): soft_counts per experiment. breaks (table_dict): breaks per experiment.

Return type:

embeddings (table_dict)