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, global_scaler: Any | None = None, pretrained: bool = False, samples_max: int = 227272, **kwargs)
Use a previously trained model to produce embeddings and soft_counts 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.
model (tf.keras.models.Model) – trained deepof unsupervised model to run inference with.
pretrained (bool) – whether to use the specified pretrained model to recluster the data.
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.
global_scaler (Any) – trained global scaler produced when processing the original dataset.
samples_max (int) – Maximum number of samples taken for plotting to avoid excessive computation times. If the number of rows in a data set exceeds this number the data is downsampled accordingly.
**kwargs – additional arguments to pass to coordinates.get_graph_dataset().
- Returns:
embeddings per experiment. soft_counts (table_dict): soft_counts per experiment.
- Return type:
embeddings (table_dict)