tfm.vision.spatial_transform_ops.crop_mask_in_target_box
Stay organized with collections
Save and categorize content based on your preferences.
Crop masks in target boxes.
tfm.vision.spatial_transform_ops.crop_mask_in_target_box(
masks: tf.Tensor,
boxes: tf.Tensor,
target_boxes: tf.Tensor,
output_size: int,
sample_offset: float = 0.0,
use_einsum: bool = True
) -> tf.Tensor
Args |
masks
|
A tensor with a shape of [batch_size, num_masks, height, width].
|
boxes
|
a float tensor representing box cooridnates that tightly enclose
masks with a shape of [batch_size, num_masks, 4] in un-normalized
coordinates. A box is represented by [ymin, xmin, ymax, xmax].
|
target_boxes
|
a float tensor representing target box cooridnates for masks
with a shape of [batch_size, num_masks, 4] in un-normalized coordinates. A
box is represented by [ymin, xmin, ymax, xmax].
|
output_size
|
A scalar to indicate the output crop size. It currently only
supports to output a square shape outputs.
|
sample_offset
|
a float number in [0, 1] indicates the subpixel sample offset
from grid point.
|
use_einsum
|
Use einsum to replace gather in selective_crop_and_resize.
|
Returns |
A 4-D tensor representing feature crop of shape
[batch_size, num_boxes, output_size, output_size].
|
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."],[],[]]