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_params_dependent_on_targets
(params)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.
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
- 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
- call_backup = None#
- fill_value: ColorType#
- mask_fill_value: Optional[ColorType]#