ListOfBlobs#

Warning

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

class idtrackerai.ListOfBlobs(blobs_in_video: list[list[Blob]])[source]#

Contains all the instances of the class Blob.

__init__(blobs_in_video: list[list[Blob]])[source]#
blobs_in_video: list[list[Blob]]#

Main and only attribute of the class, it contains a list of all Blob instances in a frame for every frame in the video

classmethod load(file_path: Path | str, verbose: bool = True) ListOfBlobs[source]#

Loads an instance of a class saved in a .pickle file.

Parameters:

file_path (Path | str) – Path to a saved instance of a ListOfBlobs object

Return type:

ListOfBlobs

save(file_path: Path | str) None[source]#

Saves instance of the class with Python’s pickle protocol

Parameters:

file_path (Path | str) – Path where to save the object

property all_blobs: Iterator[Blob]#

A flattened view of all Blobs in the video

property number_of_blobs: int#

Total number of Blobs in self

property number_of_frames: int#

Number of frames in the video, equal to the number of lists of Blobs in self

compute_overlapping_between_subsequent_frames() None[source]#

Computes overlapping between blobs in consecutive frames.

Two blobs in consecutive frames overlap if the intersection of the list of pixels of both blobs is not empty.

set_images_for_identification(episodes: list[Episode], id_images_files: list[Path], id_image_size: list[int], resolution_reduction: float, n_jobs: int) None[source]#

Computes and saves the images used to classify blobs as crossings and individuals and to identify the animals along the video.

add_blob(frame_number: int, centroid: tuple, identity: int)[source]#

[Validation] Adds a Blob object the frame number.

Adds a Blob object to a given frame_number with a given centroid and identity. Note that this Blob won’t have most of the features (e.g. area, contour, fragment_identifier, bbox, …). It is only intended to be used for validation and correction of trajectories. The new blobs generated are considered to be individuals.

Parameters:
  • frame_number (int) – Frame in which the new blob will be added

  • centroid (tuple) – The centroid of the new blob

  • identity (int) – Identity of the new blob

property max_number_of_blobs_in_one_frame#

Max number of blobs in one frame

Deprecated since version 6.0.0: Use max(map(len, ListOfBlobs.blobs_in_video)) instead

load_from_v4()[source]#

Load from v4

Deprecated since version 6.0.0: Loading ListOfBlobs from v4 is not supported anymore

update_id_image_dataset_with_crossings()[source]#

Update id image dataset with crossings

Deprecated since version 6.0.0: Use idtrackerai.base.crossings_detection.crossing_detector._upd ate_id_image_dataset_with_crossings instead

reset_user_generated_corrections()[source]#

Reset user generated corrections

Deprecated since version 6.0.0: Use idtrackerai.extra_tools.validator.validation_GUI.Validation GUI.reset_session() instead