dgs.utils.track.Track

class dgs.utils.track.Track(N: int, curr_frame: int, states: list[State] | None = None, tid: int = -1)[source]

A Track is a single (de-)queue containing multiple State’s, keeping the last N states.

Parameters:
  • N – The max length of this track.

  • states – A list of State objects, describing the initial values of this track. Default None.

  • tid – The Track ID of this object. Default -1.

Methods

__init__(N: int, curr_frame: int, states: list[State] | None = None, tid: int = -1) None[source]
age(curr_frame: int) int[source]

Get the age of this track (in frames).

The age does not account for frames where the track has been deleted.

append(state: State) None[source]

Append a new state to the Track.

clear() None[source]

Clear all the states from the Track.

copy() Track[source]

Return a (deep) copy of self.

get_all() State[source]

Get all the states from the Track and stack them into a single State.

set_active() None[source]
set_inactive() None[source]

Set the status of this Track to inactive and clean up older states.

set_reactivated(tid: int) None[source]
set_removed() None[source]
set_status(status: TrackStatus, tid: int = 0) None[source]

Set the status of this Track.

to(*args, **kwargs) Track[source]

Call .to() like you do with any other torch.Tensor.

Attributes

N

Get the max length of this Track.

device

Get the device of every tensor in this Track.

id

nof_active

status