MinMaxNormalize#

class MinMaxNormalize[source]#

Bases: ImageOnlyTransform

Albumentations transform that normalizes image to desired min and max values.

This will shift and scale the image appropriately to achieve the desired min and max.

Attributes

__init__(min_val=0.0, max_val=1.0, dtype=5, always_apply=False, p=1.0)[source]#

Constructor.

Parameters
  • min_val – the minimum value that output should have

  • max_val – the maximum value that output should have

  • dtype – the dtype of output image

Methods

__init__([min_val, max_val, dtype, ...])

Constructor.

add_targets(additional_targets)

Add targets to transform them the same way as one of existing targets ex: {'target_image': 'image'} ex: {'obj1_mask': 'mask', 'obj2_mask': 'mask'} by the way you must have at least one object with key 'image'

apply(image, **params)

apply_with_params(params, *args, **kwargs)

get_base_init_args()

get_class_fullname()

get_dict_with_id()

get_params()

get_params_dependent_on_targets(params)

get_transform_init_args()

get_transform_init_args_names()

is_serializable()

set_deterministic(flag[, save_key])

to_dict([on_not_implemented_error])

Take a transform pipeline and convert it to a serializable representation that uses only standard python data types: dictionaries, lists, strings, integers, and floats.

to_dict_private()

update_params(params, **kwargs)

__init__(min_val=0.0, max_val=1.0, dtype=5, always_apply=False, p=1.0)[source]#

Constructor.

Parameters
  • min_val – the minimum value that output should have

  • max_val – the maximum value that output should have

  • dtype – the dtype of output image

add_targets(additional_targets: Dict[str, str]) None#

Add targets to transform them the same way as one of existing targets ex: {‘target_image’: ‘image’} ex: {‘obj1_mask’: ‘mask’, ‘obj2_mask’: ‘mask’} by the way you must have at least one object with key ‘image’

Parameters

additional_targets (dict) – keys - new target name, values - old target name. ex: {‘image2’: ‘image’}

Return type

None

apply(image, **params)[source]#
apply_with_params(params: Dict[str, Any], *args: Any, **kwargs: Any) Dict[str, Any]#
Parameters
Return type

Dict[str, Any]

get_base_init_args() Dict[str, Any]#
Return type

Dict[str, Any]

classmethod get_class_fullname() str#
Return type

str

get_dict_with_id() Dict[str, Any]#
Return type

Dict[str, Any]

get_params() Dict[str, Any]#
Return type

Dict[str, Any]

get_params_dependent_on_targets(params: Dict[str, Any]) Dict[str, Any]#
Parameters

params (Dict[str, Any]) –

Return type

Dict[str, Any]

get_transform_init_args() Dict[str, Any]#
Return type

Dict[str, Any]

get_transform_init_args_names()[source]#
classmethod is_serializable() bool#
Return type

bool

set_deterministic(flag: bool, save_key: str = 'replay') BasicTransform#
Parameters
  • flag (bool) –

  • save_key (str) –

Return type

BasicTransform

to_dict(on_not_implemented_error: str = 'raise') Dict[str, Any]#

Take a transform pipeline and convert it to a serializable representation that uses only standard python data types: dictionaries, lists, strings, integers, and floats.

Parameters
  • self – A transform that should be serialized. If the transform doesn’t implement the to_dict method and on_not_implemented_error equals to ‘raise’ then NotImplementedError is raised. If on_not_implemented_error equals to ‘warn’ then NotImplementedError will be ignored but no transform parameters will be serialized.

  • on_not_implemented_error (str) – raise or warn.

Return type

Dict[str, Any]

to_dict_private() Dict[str, Any]#
Return type

Dict[str, Any]

update_params(params: Dict[str, Any], **kwargs: Any) Dict[str, Any]#
Parameters
Return type

Dict[str, Any]

call_backup = None#
fill_value: ColorType#
interpolation: Union[int, Interpolation]#
mask_fill_value: Optional[ColorType]#
property target_dependence: Dict[str, Any]#
property targets: Dict[str, Callable[[...], Any]]#
property targets_as_params: List[str]#