idtrackerai.extra_tools.cluster_inspection#

Warning

The code reference is a work in progress and may contain inconsistencies.

A simple module to inspect contrastive clusters after tracking, see Cluster inspection.

idtrackerai.extra_tools.cluster_inspection.inspect_clusters(session_path: Path, images_per_id: float = 500, gt_path: Path | None = None) None[source]#

Use the trained ResNet to embed all images used in contrastive training or a subset of them, compute the t-SNE representation in 2D and save the results in a .png scatter plot and a .csv file.

Parameters:
  • session_path (Path) – _description_

  • images_per_id (int, optional) – _description_, by default 500

Raises:

IdtrackeraiError – _description_

idtrackerai.extra_tools.cluster_inspection.scatter_plot(x: ndarray, y: ndarray, labels: ndarray, file: Path | str)[source]#

Expected Numpy array with IDs from 1 to n_animals, 0 values meaning unknown