Linker
- class byotrack.api.linker.Linker
Bases:
ABC,ParametrizedObjectMixinBase class for linkers in videos
Link detections through time to build tracks.
Each linker can define a set of parameters (See ParametrizedObjectMixin)
- abstract run(video: Sequence[ndarray] | ndarray, detections_sequence: Sequence[Detections]) Collection[Track]
Run the linker on a whole video
- Parameters:
video (Sequence[np.ndarray] | np.ndarray) – Sequence of T frames (array). Each array is expected to have a shape (H, W, C)
detections_sequence (Sequence[byotrack.Detections]) – Detections for each frame Detections is expected for each frame of the video, in the same order. (Note that for a given frame, the Detections can be empty)
- Returns:
Tracks of particles
- Return type:
Collection[byotrack.Track]
- class byotrack.api.linker.OnlineLinker
Bases:
LinkerOnline linker, it tracks particles one frame at a time
The linking algorithm is dividing into three steps:
reset: Reset the algorithm
update: Update the algorithm with a new frame and detections
collect: Collect the constructed tracks up to the last frame
- reset() None
Reset the linking algorithm
Flush all data stored from a previous linking and prepare a new linking
- abstract update(frame: ndarray, detections: Detections) None
Progress in the linking step by one frame
Will update the internal algorithm by a single frame and its detections.
- Parameters:
frame (np.ndarray) – Frame of the video Shape: (H, W, C), dtype: float
detections (byotrack.Detections) – Detections for the given frame
- abstract collect() Collection[Track]
Collect and build all the tracks up to the last given frame
- Returns:
Tracks from the last reset to the last given frame.
- Return type:
Collection[byotrack.Track]
- run(video: Sequence[ndarray] | ndarray, detections_sequence: Sequence[Detections]) Collection[Track]
Run the linker on a whole video
- Parameters:
video (Sequence[np.ndarray] | np.ndarray) – Sequence of T frames (array). Each array is expected to have a shape (H, W, C)
detections_sequence (Sequence[byotrack.Detections]) – Detections for each frame Detections is expected for each frame of the video, in the same order. (Note that for a given frame, the Detections can be empty)
- Returns:
Tracks of particles
- Return type:
Collection[byotrack.Track]