View source on GitHub |
Image perceptual quality loss.
mediapipe_model_maker.face_stylizer.face_stylizer.loss_functions.ImagePerceptualQualityLoss(
loss_weight: Optional[mediapipe_model_maker.face_stylizer.face_stylizer.loss_functions.PerceptualLossWeight
] = None,
reduction: tf.keras.losses.Reduction = tf.keras.losses.Reduction.NONE
)
It obtains a weighted loss between the VGGPerceptualLoss and L1 loss.
Methods
from_config
@classmethod
from_config( config )
Instantiates a Loss
from its config (output of get_config()
).
Args | |
---|---|
config
|
Output of get_config() .
|
Returns | |
---|---|
A Loss instance.
|
get_config
get_config()
Returns the config dictionary for a Loss
instance.
__call__
__call__(
img1: tf.Tensor, img2: tf.Tensor
) -> tf.Tensor
Computes image perceptual quality loss.