tracksdata
A common data structure and basic tools for multi-object tracking.
Modules:
-
array
–Array representation of graphical data.
-
attrs
–Module to compose attribute expressions for attribute filtering or value evaluation.
-
constants
–Module to define default and often global values used through
tracksdata
. -
edges
–Edge operators for creating connections between nodes of a graph.
-
functional
–Functional utilities for graph operations.
-
graph
–Graph backends for representing tracking data as directed graphs in memory or on disk.
-
io
–Input/output utilities for loading and saving tracking data in various formats.
-
metrics
–Evaluation metrics for tracking performance, including the CTC benchmark metrics.
-
nodes
–Node operators for creating nodes and their respective attributes (e.g. masks) in a graph.
-
options
–Global options system for TracksData.
-
solvers
–Solvers for finding a valid tracking solution from a candidate graph.
-
utils
–Utility functions for data processing, type conversions, and progress tracking.
Classes:
-
EdgeAttr
–Wrapper of Attr to represent an edge attribute.
-
NodeAttr
–Wrapper of Attr to represent a node attribute.
EdgeAttr
Bases: Attr
Wrapper of Attr to represent an edge attribute.
See Also
Attr: The base class for all attributes.
Methods:
-
evaluate
–Evaluate the expression on a DataFrame returning a numeric result.
-
has_inf
–Check if any column in the expression is multiplied by infinity or negative infinity.
-
has_neg_inf
–Check if any column in the expression is multiplied by negative infinity.
-
has_pos_inf
–Check if any column in the expression is multiplied by positive infinity.
Attributes:
-
expr_columns
(list[str]
) –Get the names of columns in the expression.
-
inf_columns
(list[str]
) –Get the names of columns multiplied by positive infinity.
-
inf_exprs
(list[Attr]
) –Get the expressions multiplied by positive infinity.
-
neg_inf_columns
(list[str]
) –Get the names of columns multiplied by negative infinity.
-
neg_inf_exprs
(list[Attr]
) –Get the expressions multiplied by negative infinity.
Source code in src/tracksdata/attrs.py
inf_columns
property
Get the names of columns multiplied by positive infinity.
neg_inf_columns
property
Get the names of columns multiplied by negative infinity.
neg_inf_exprs
property
Get the expressions multiplied by negative infinity.
_delegate_comparison_operator
_delegate_comparison_operator(other: ExprInput, op: Callable, reverse: bool = False) -> AttrComparison | Attr
Simplified version of _delegate_operator
for comparison operators.
AttrComparison has a limited scope and
it's mainly used for filtering.
If creating an AttrComparison object is
not possible, it will return an Attr object.
Parameters:
-
other
ExprInput
) –The other expression to delegate the operator to.
-
op
Callable
) –The operator to delegate.
-
reverse
bool
, default:False
) –Whether the operator is reversed.
Returns:
-
AttrComparison | Attr
–The result of the operator.
Source code in src/tracksdata/attrs.py
_delegate_operator
_delegate_operator(other: ExprInput, op: Callable[[Expr, Expr], Expr], reverse: bool = False) -> Attr
Delegate the operator to the expression.
Parameters:
-
other
ExprInput
) –The other expression to delegate the operator to.
-
op
Callable[[Expr, Expr], Expr]
) –The operator to delegate.
-
reverse
bool
, default:False
) –Whether the operator is reversed.
Returns:
-
Attr
–The result of the operator.
Source code in src/tracksdata/attrs.py
evaluate
Evaluate the expression on a DataFrame returning a numeric result.
Parameters:
-
df
DataFrame
) –The DataFrame to evaluate the expression on.
Returns:
-
Series
–The evaluated expression.
Source code in src/tracksdata/attrs.py
has_inf
Check if any column in the expression is multiplied by infinity or negative infinity.
Returns:
-
bool
–True if any column is multiplied by infinity, False otherwise.
Source code in src/tracksdata/attrs.py
has_neg_inf
has_pos_inf
NodeAttr
Bases: Attr
Wrapper of Attr to represent a node attribute.
See Also
Attr: The base class for all attributes.
Methods:
-
evaluate
–Evaluate the expression on a DataFrame returning a numeric result.
-
has_inf
–Check if any column in the expression is multiplied by infinity or negative infinity.
-
has_neg_inf
–Check if any column in the expression is multiplied by negative infinity.
-
has_pos_inf
–Check if any column in the expression is multiplied by positive infinity.
Attributes:
-
expr_columns
(list[str]
) –Get the names of columns in the expression.
-
inf_columns
(list[str]
) –Get the names of columns multiplied by positive infinity.
-
inf_exprs
(list[Attr]
) –Get the expressions multiplied by positive infinity.
-
neg_inf_columns
(list[str]
) –Get the names of columns multiplied by negative infinity.
-
neg_inf_exprs
(list[Attr]
) –Get the expressions multiplied by negative infinity.
Source code in src/tracksdata/attrs.py
inf_columns
property
Get the names of columns multiplied by positive infinity.
neg_inf_columns
property
Get the names of columns multiplied by negative infinity.
neg_inf_exprs
property
Get the expressions multiplied by negative infinity.
_delegate_comparison_operator
_delegate_comparison_operator(other: ExprInput, op: Callable, reverse: bool = False) -> AttrComparison | Attr
Simplified version of _delegate_operator
for comparison operators.
AttrComparison has a limited scope and
it's mainly used for filtering.
If creating an AttrComparison object is
not possible, it will return an Attr object.
Parameters:
-
other
ExprInput
) –The other expression to delegate the operator to.
-
op
Callable
) –The operator to delegate.
-
reverse
bool
, default:False
) –Whether the operator is reversed.
Returns:
-
AttrComparison | Attr
–The result of the operator.
Source code in src/tracksdata/attrs.py
_delegate_operator
_delegate_operator(other: ExprInput, op: Callable[[Expr, Expr], Expr], reverse: bool = False) -> Attr
Delegate the operator to the expression.
Parameters:
-
other
ExprInput
) –The other expression to delegate the operator to.
-
op
Callable[[Expr, Expr], Expr]
) –The operator to delegate.
-
reverse
bool
, default:False
) –Whether the operator is reversed.
Returns:
-
Attr
–The result of the operator.
Source code in src/tracksdata/attrs.py
evaluate
Evaluate the expression on a DataFrame returning a numeric result.
Parameters:
-
df
DataFrame
) –The DataFrame to evaluate the expression on.
Returns:
-
Series
–The evaluated expression.
Source code in src/tracksdata/attrs.py
has_inf
Check if any column in the expression is multiplied by infinity or negative infinity.
Returns:
-
bool
–True if any column is multiplied by infinity, False otherwise.