tfm.vision.augment.cutout_video
Stay organized with collections
Save and categorize content based on your preferences.
Apply cutout (https://arxiv.org/abs/1708.04552) to a video.
tfm.vision.augment.cutout_video(
video: tf.Tensor, mask_shape: Optional[tf.Tensor] = None, replace: int = 0
) -> tf.Tensor
This operation applies a random size 3D mask of zeros to a random location
within video
. The mask is padded The pixel values filled in will be of the
value replace
. The location where the mask will be applied is randomly
chosen uniformly over the whole video. If the size of the mask is not set,
then, it is randomly sampled uniformly from [0.25height, 0.5height],
[0.25width, 0.5width], and [1, 0.25*depth], which represent the height,
width, and number of frames of the input video tensor respectively.
Args |
video
|
A video Tensor of shape [T, H, W, C].
|
mask_shape
|
An optional integer tensor that specifies the depth, height and
width of the mask to cut. If it is not set, the shape is randomly sampled
as described above. The shape dimensions should be divisible by 2
otherwise they will rounded down.
|
replace
|
What pixel value to fill in the image in the area that has the
cutout mask applied to it.
|
Returns |
A video Tensor with cutout applied.
|
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. Some content is licensed under the numpy license.
Last updated 2024-02-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-02-02 UTC."],[],[]]