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 can hold a single value (e.g., a scalar) and supply it on-demand to other parts of the pipeline. It does not transform the input image. Instead, it returns the stored scalar (or array) value.
Parameters#
- valuePropertyLike[float], optional
The numerical value to store. Defaults to 0. If an Image is provided, a warning is issued suggesting convertion to a NumPy array for performance reasons.
- **kwargsDict[str, 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.
Examples#
>>> from deeptrack.features import Value
>>> value = Value(42) >>> print(value()) 42
Overriding the value at call time:
>>> print(value(value=100)) 100
>>> print(value()) 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.
Parameters#
- imageAny
Input data that would normally be transformed by a feature, but Value does not modify or use it.
- valuefloat
The current (possibly overridden) value stored in this feature.
- **kwargsDict[str, Any]
Additional properties or overrides that are not used here.
Returns#
- float
The value property, unchanged.