OneStepPerturbImageFactory

class nrtk.impls.perturb_image_factory.generic.one_step.OneStepPerturbImageFactory(perturber: type[PerturbImage], theta_key: str, theta_value: float)

Simple PerturbImageFactory implementation to return a factory with one perturber.

Methods

from_config

Instantiates a PerturbImageFactory from a configuration dictionary.

get_config

Generates a configuration dictionary for the OneStepPerturbImageFactory instance.

get_default_config

Returns the default configuration for the PerturbImageFactory.

get_impls

Discover and return a set of classes that implement the calling class.

is_usable

Check whether this class is available for use.

__init__(perturber: type[PerturbImage], theta_key: str, theta_value: float) None

Initialize the factory to produce an instance of PerturbImage for the given type.

Initialize the factory to produce an instance of PerturbImage for the given type, given the theta_key and the theta_value parameters.

Parameters:
  • perturber – Python implementation type of the PerturbImage interface to produce.

  • theta_key – Perturber parameter to set for the instance.

  • theta_value – Initial and only value of theta_key.

Raises:

TypeError – Given a perturber instance instead of type.

get_config() dict[str, Any]

Generates a configuration dictionary for the OneStepPerturbImageFactory instance.

Returns:

dict[str, Any]: Configuration data representing the sensor and scenario.