tf.keras.ops.image.extract_es

Extracts es from the image(s).

imageInput image or batch of images. Must be 3D or 4D.
sizesize int or tuple (_height, _widht)
stridesstrides along height and width. If not specified, or if None, it defaults to the same value as size.
dilation_rateThis is the input stride, specifying how far two consecutive samples are in the input. For value other than 1, strides must be 1. NOTE: strides > 1 is not supported in conjunction with dilation_rate > 1
paddingThe type of padding algorithm to use: "same" or "valid".
data_formatstring, either "channels_last" or "channels_first". The ordering of the dimensions in the inputs. "channels_last" corresponds to inputs with shape (batch, height, width, channels) while "channels_first" corresponds to inputs with shape (batch, channels, height, weight). It defaults to the image_data_format value found in your Keras config file at ~/.keras/keras.json. If you never set it, then it will be "channels_last".

Extracted es 3D (if not batched) or 4D (if batched)

Examples:

image = np.random.random(
    (2, 20, 20, 3)
).astype("float32") # batch of 2 RGB images
es = keras.ops.image.extract_es(image, (5, 5))
es.shape
(2, 4, 4, 75)
image = np.random.random((20, 20, 3)).astype("float32") # 1 RGB image
es = keras.ops.image.extract_es(image, (3, 3), (1, 1))
es.shape
(18, 18, 27)