NOPPerturber
- class nrtk.impls.perturb_image.generic.nop_perturber.NOPPerturber
Example implementation of the
PerturbImageinterface.An instance of this class acts as a functor to generate a perturbed image for the given input image stimulus.
This class, in particular, serves as pass-through “no operation” (NOP) perturber.
Methods
from_configInstantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
get_configReturns the current configuration of the PerturbImage instance.
get_default_configGenerate and return a default configuration dictionary for this class.
get_implsDiscover and return a set of classes that implement the calling class.
get_type_stringReturns the fully qualified type string of the PerturbImage class or its subclass.
is_usableCheck whether this class is available for use.
Returns unperturbed image and input bounding boxes.
- perturb(image: ndarray[Any, Any], boxes: Iterable[tuple[AxisAlignedBoundingBox, dict[Hashable, float]]] | None = None, additional_params: dict[str, Any] | None = None) tuple[ndarray[Any, Any], Iterable[tuple[AxisAlignedBoundingBox, dict[Hashable, float]]] | None]
Returns unperturbed image and input bounding boxes.
- Args:
- image:
Input image as a numpy array of shape (H, W, C).
- boxes:
List of bounding boxes in AxisAlignedBoundingBox format and their corresponding classes.
- additional_params:
Additional parameters for perturbation.
- Returns:
- return tuple[np.ndarray, Iterable[tuple[AxisAlignedBoundingBox, dict[Hashable, float]]] | None]:
Returns the source image and bounding boxes.