UpscaleResizeImagesBlock
- class lib.model.nn_blocks.UpscaleResizeImagesBlock(filters: int, kernel_size: int | tuple[int, int] = 3, padding: str = 'same', activation: str | None = 'leakyrelu', scale_factor: int = 2, interpolation: Literal['nearest', 'bilinear'] = 'bilinear')
Bases:
objectUpscale block that uses the Keras Backend function resize_images to perform the up scaling Similar in methodology to the
Upscale2xBlockAdds reflection padding if it has been selected by the user, and other post-processing if requested by the plugin.
- Parameters:
filters (int) – The dimensionality of the output space (i.e. the number of output filters in the convolution)
kernel_size (int, optional) – An integer or tuple/list of 2 integers, specifying the height and width of the 2D convolution window. Can be a single integer to specify the same value for all spatial dimensions. Default: 3
padding (["valid", "same"], optional) – The padding to use. Default: “same”
activation (str or
None, optional) – The activation function to use. This is applied at the end of the convolution block. Select one of “leakyrelu”, “prelu” or “swish”. Set toNoneto not apply an activation function. Default: “leakyrelu”scale_factor (int, optional) – The amount to upscale the image. Default: 2
interpolation (["nearest", "bilinear"], optional) – Interpolation to use for up-sampling. Default: “bilinear”
kwargs (dict) – Any additional Keras standard layer keyword arguments to pass to the Convolutional 2D layer
Methods Summary
__call__(inputs)Call the Faceswap Resize Images Layer.
Methods Documentation
- __call__(inputs: KerasTensor) KerasTensor
Call the Faceswap Resize Images Layer.
- Parameters:
inputs (
keras.KerasTensor) – The input to the layer- Returns:
The output tensor from the Upscale Layer
- Return type:
keras.KerasTensor
- __call__(inputs: KerasTensor) KerasTensor
Call the Faceswap Resize Images Layer.
- Parameters:
inputs (
keras.KerasTensor) – The input to the layer- Returns:
The output tensor from the Upscale Layer
- Return type:
keras.KerasTensor