ListOfGlobalFragments#
Warning
The code reference is a work in progress and may contain inconsistencies.
- class idtrackerai.ListOfGlobalFragments(global_fragments: Iterable[GlobalFragment])[source]#
Contains all the instances of the class
GlobalFragment.It contains methods to retrieve information from these global fragments and to update their attributes. These methods are mainly used during the cascade of training and identification protocols.
- Parameters:
global_fragments (list) – List of instances of
GlobalFragment.
- __init__(global_fragments: Iterable[GlobalFragment])[source]#
- global_fragments: list[GlobalFragment]#
List of global fragments which are candidate for accumulation
- non_accumulable_global_fragments: list[GlobalFragment]#
List of global fragments which are NOT candidate for accumulation
- classmethod from_fragments(blobs_in_video: list[list[Blob]], fragments: list[Fragment], num_animals: int) ListOfGlobalFragments[source]#
Creates the list of instances of the class
GlobalFragment.- Parameters:
- Returns:
The list of all Global Fragments
- Return type:
- sort_by_distance_to_the_frame(frame_number: int)[source]#
Sorts the global fragments with respect to their distance from the first global fragment chose for accumulation.
- save(path: Path | str)[source]#
Saves an instance of the class.
Before saving the instances of fragments associated to every global fragment are removed and reset them after saving. This prevents problems when pickling objects inside of objects.
- Parameters:
path (Path | str) – Path where the object will be stored
- classmethod load(path: Path | str, fragments: list[Fragment] | None = None) ListOfGlobalFragments[source]#
Loads an instance of the class saved with
save()- Parameters:
path (str) – Path where the object to be loaded is stored.
fragments (list) – List of all the instances of the class
Fragmentin the video.