Value#

class deeptrack.features.Value(value: float | Callable[[...], float] = 0, **kwargs: dict[str, Any])#

Bases: Feature

Represents a constant (per evaluation) value in a DeepTrack pipeline.

This feature holds a constant value (e.g., a scalar or array) and supplies it on demand to other parts of the pipeline. It does not transform the input image but instead returns the stored value.

Parameters#

value: PropertyLike[float], optional

The numerical value to store. Defaults to 0. If an Image is provided, a warning is issued recommending conversion to a NumPy array for The numerical value to store. Defaults to 0. If an Image is provided, a warning is issued recommending conversion to a NumPy array for performance reasons.

**kwargs: dict of str to Any

Additional named properties passed to the Feature constructor.

Attributes#

__distributed__: bool

Set to False, indicating that this feature’s get(…) method processes the entire list of images (or data) at once, rather than distributing calls for each item.

Methods#

get(image: Any, value: float, **kwargs: dict[str, Any]) -> float

Returns the stored value, ignoring the input image.

Examples#

>>> import deeptrack as dt

Initialize a constant value and retrieve it: >>> value = dt.Value(42) >>> print(value()) 42

Override the value at call time: >>> print(value(value=100)) 100

Methods Summary

get(image, value, **kwargs)

Return the stored value, ignoring the input image.

Methods Documentation

get(image: Any, value: float, **kwargs: dict[str, Any]) float#

Return the stored value, ignoring the input image.

The get method simply returns the stored numerical value, allowing for dynamic overrides when the feature is called.

Parameters#

image: Any

Input data typically processed by features. For Value, this is ignored and does not affect the output.

value: float

The current value to return. This may be the initial value or an overridden value supplied during the method call.

**kwargs: dict of str to Any

Additional keyword arguments, which are ignored but included for consistency with the feature interface.

Returns#

float

The stored or overridden value, returned unchanged.