tfm.vision.anchor.AnchorGeneratorv2
Stay organized with collections
Save and categorize content based on your preferences.
Utility to generate anchors for a multiple feature maps.
tfm.vision.anchor.AnchorGeneratorv2(
min_level, max_level, num_scales, aspect_ratios, anchor_size
)
Attributes |
min_level
|
integer number of minimum level of the output feature pyramid.
|
max_level
|
integer number of maximum level of the output feature pyramid.
|
num_scales
|
integer number representing intermediate scales added on each
level. For instances, num_scales=2 adds one additional intermediate
anchor scales [2^0, 2^0.5] on each level.
|
aspect_ratios
|
list of float numbers representing the aspect ratio anchors
added on each level. The number indicates the ratio of width to height.
For instances, aspect_ratios=[1.0, 2.0, 0.5] adds three anchors on each
scale level.
|
anchor_size
|
float number representing the scale of size of the base
anchor to the feature stride 2^level.
|
Methods
__call__
View source
__call__(
image_size
)
Generate multilevel anchor boxes.
| Args |
image_size
|
a list of integer numbers or Tensors representing [height,
width] of the input image size.
|
| Returns |
|
An ordered dictionary from level to anchor boxes of shape [height_l,
width_l, num_anchors_per_location * 4].
|
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 2026-11-06 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 2026-11-06 UTC."],[],[]]