tfg.image.matting.loss
Computes the matting loss function based on the matting Laplacian.
tfg.image.matting.loss(
matte: type_alias.TensorLike,
laplacian: type_alias.TensorLike,
name: str = 'matting_loss'
) -> tf.Tensor
Computes the matting loss function based on the laplacian
generated by the
build_matrices
function which implements the approach proposed by Levin
et al. in "A Closed Form Solution to Natural Image Matting".
Args |
matte
|
A tensor of shape [B, H, W, 1] .
|
laplacian
|
A tensor of shape [B, H - pad, W - pad, size^2, size^2]
containing the Laplacian matrices computed by the build_matrices
function, where pad is equal to size - 1 and size is the patch size
used to compute this tensor.
|
name
|
A name for this op. Defaults to "matting_loss".
|
Returns |
A tensor containing a scalar value defining the matting loss.
|
Raises |
ValueError
|
If the last dimension of matte is not 1. If matte is not
of rank 4. If the last two dimensions of laplacian are not of the
same size. If laplacian is not of rank 5. If B is different
between matte and laplacian .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-10-28 UTC.
[null,null,["Last updated 2022-10-28 UTC."],[],[]]