Bind#

class deeptrack.features.Bind(feature: Feature, **kwargs: Any)#

Bases: StructuralFeature

Bind a feature with property arguments.

When the feature is resolved, the keyword arguments (kwargs) are passed to the child feature. Thus, this feature allows passing additional keyword arguments to a child feature when it is resolved. These properties can dynamically control the behavior of the child feature.

Parameters#

feature: Feature

The child feature.

**kwargs: Any

Properties to send to child.

Methods#

get(inputs, **kwargs) -> Any

Resolves the child feature with the provided arguments.

Examples#

>>> import deeptrack as dt

Start by creating a Gaussian feature:

>>> gaussian_noise = dt.Gaussian()

Create a test image:

>>> import numpy as np
>>>
>>> input_array = np.zeros((512, 512))

Bind fixed values to the parameters:

>>> bound_feature = dt.Bind(gaussian_noise, mu=-5, sigma=2)

Resolve the bound feature:

>>> output_array = bound_feature.resolve(input_array)
>>> round(np.mean(output_array), 1), round(np.std(output_array), 1)
(-5.0, 2.0)

Methods Summary

get(inputs, **kwargs)

Resolve the child feature with the dynamically provided arguments.

Methods Documentation

get(inputs: Any, **kwargs: Any) Any#

Resolve the child feature with the dynamically provided arguments.

Parameters#

inputs: Any

The input data to process.

**kwargs: Any

Properties or arguments to pass to the child feature during resolution.

Returns#

Any

The result of resolving the child feature with the provided arguments.