DummyFeature#

class deeptrack.features.DummyFeature(_input: Any = [], **kwargs: Dict[str, Any])#

Bases: Feature

A 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 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#

_inputUnion[‘Image’, List[‘Image’]], optional

An optional input (image or list of images) that can be set for the feature. By default, an empty list.

**kwargsDict[str, Any]

Additional keyword arguments are wrapped as Property instances and stored in self.properties.

Example#

>>> import numpy as np
>>> from deeptrack.features import DummyFeature

Create an image: >>> dummy_image = np.ones((60, 80))

Initialize the DummyFeature:

>>> dummy_feature = DummyFeature(value=42)

Pass the image through the DummyFeature:

>>> output_image = dummy_feature(dummy_image)

The output should be identical to the input:

>>> np.array_equal(dummy_image, output_image)
True

Access the properties stored in DummyFeature:

>>> dummy_feature.properties["value"]()
42

This example illustrates that the DummyFeature can act as a container for properties, while the data itself remains unaltered.

Methods Summary

get(image, **kwargs)

Return the input image or list of images unchanged.

Methods Documentation

get(image: Image | List[Image], **kwargs: Any) Image | List[Image]#

Return the input image or list of images unchanged.

Parameters#

image‘Image’ or List[‘Image’]

The image(s) to pass through without modification.

**kwargsAny

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[‘Image’]

The same image object that was passed in.