Tracks
- class byotrack.api.tracks.Track(start: int, points: Tensor, identifier: int | None = None)
Bases:
objectTrack for a given particle
A track is defined by an (non-unique) identifier, a starting frame and a succession of positions.
- points
Positions (i, j) of the particle (from starting frame to ending frame) Shape: (T, D), dtype: float32
- Type:
torch.Tensor
- overlaps_with(other: Track, tolerance=0) bool
Test if this track overlaps with another one in time.
- static tensorize(tracks: Collection[Track], frame_range: Tuple[int, int] | None = None) Tensor
Convert a collection of tracks into a tensor on a given frame_range
Useful view of the data to speedup some mathematical operations
- Parameters:
- Returns:
- Tracks data in a single tensor
Shape: (T, N, D), dtype: float32
- Return type:
torch.Tensor
- static save(tracks: Collection[Track], path: str | PathLike) None
Save a collection of tracks to path
- Parameters:
tracks (Collection[Track]) – Tracks to save
path (str | os.PathLike) – Output path
- static load(path: str | PathLike) Collection[Track]
Load a collection of tracks from path
- Parameters:
path (str | os.PathLike) – Input path