DummyFeature#
- class deeptrack.features.DummyFeature(_input: Any = [], **kwargs: dict[str, Any])#
Bases:
FeatureA no-op feature that simply returns the input unchanged.
This class can serve as a container for properties that don’t directly transform the data but need to be logically grouped. Since it inherits transform the data but need to be logically grouped. Since it inherits from Feature, any keyword arguments passed to the constructor are stored as Property instances in self.properties, enabling dynamic behavior or parameterization without performing any transformations on the input data.
Parameters#
- _input: np.ndarray or list np.ndarray or Image or list of Images, optional
An optional input (image or list of images) that can be set for the feature. By default, an empty list.
- **kwargs: dict of str to Any
Additional keyword arguments are wrapped as Property instances and stored in self.properties.
Methods#
- get(image: np.ndarray | list np.ndarray | Image | list[Image], **kwargs: dict[str, Any]) -> Image | list[Image]
Simply returns the input image(s) unchanged.
Examples#
>>> import deeptrack as dt >>> import numpy as np
Create an image and pass it through a DummyFeature to demonstrate no changes to the input data: >>> dummy_image = np.ones((60, 80))
Initialize the DummyFeature: >>> dummy_feature = dt.DummyFeature(value=42)
Pass the image through the DummyFeature: >>> output_image = dummy_feature(dummy_image)
Verify the output is identical to the input: >>> print(np.array_equal(dummy_image, output_image)) True
Access the properties stored in DummyFeature: >>> print(dummy_feature.properties[“value”]()) 42
Methods Summary
get(image, **kwargs)Return the input image or list of images unchanged.
Methods Documentation
- get(image: np.ndarray | list[np.ndarray] | Image | list[Image], **kwargs: Any) Image | list[Image]#
Return the input image or list of images unchanged.
This method simply returns the input without applying any transformation. It adheres to the Feature interface by accepting additional keyword arguments for consistency, although they are not used in this method.
Parameters#
- image: np.ndarray or list np.ndarray or Image or list of Image
The image or list of images to pass through without modification.
- **kwargs: Any
Additional properties sampled from self.properties or passed externally. These are unused here but provided for consistency with the Feature interface.
Returns#
- Image or list of Images
The same image object that was passed in.