tf.keras.layers.AutoContrast

Performs the auto-contrast operation on an image.

Inherits From: Layer, Operation

Auto contrast stretches the values of an image across the entire available value_range. This makes differences between pixels more obvious. An example of this is if an image only has values [0, 1] out of the range [0, 255], auto contrast will change the 1 values to be 255.

This layer is active at both training and inference time.

value_range Range of values the incoming images will have. Represented as a two number tuple written (low, high). This is typically either (0, 1) or (0, 255) depending on how your preprocessing pipeline is set up. Defaults to (0, 255).

input Retrieves the input tensor(s) of a symbolic operation.

Only returns the tensor(s) corresponding to the first time the operation was called.

output Retrieves the output tensor(s) of a layer.

Only returns the tensor(s) corresponding to the first time the operation was called.

Methods

convert_weight

View source

Convert the weight if it is from the a different backend.

from_config

View source

Creates an operation from its config.

This method is the reverse of get_config, capable of instantiating the same operation from the config dictionary.

if "dtype" in config and isinstance(config["dtype"], dict):
    policy = dtype_policies.deserialize(config["dtype"])

Args
config A Python dictionary, typically the output of get_config.

Returns
An operation instance.

get_random_transformation

View source

transform_bounding_boxes

View source

transform_images

View source

transform_labels

View source

transform_segmentation_masks

View source

transform_single_bounding_box

View source

transform_single_image

View source

transform_single_label

View source

transform_single_segmentation_mask

View source