tfm.vision.anchor.Anchor
Stay organized with collections
Save and categorize content based on your preferences.
Anchor class for anchor-based object detectors.
tfm.vision.anchor.Anchor(
min_level, max_level, num_scales, aspect_ratios, anchor_size, image_size
)
Example:
anchor_boxes = Anchor(
min_level=3,
max_level=4,
num_scales=2,
aspect_ratios=[0.5, 1., 2.],
anchor_size=4.,
image_size=[256, 256],
).multilevel_boxes
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.
|
image_size
|
a list of integer numbers or Tensors representing [height,
width] of the input image size.
|
multilevel_boxes
|
an OrderedDict from level to the generated anchor boxes of
shape [height_l, width_l, num_anchors_per_location * 4].
|
anchors_per_location
|
number of anchors per pixel location.
|
[null,null,["Last updated 2026-11-06 UTC."],[],[]]