Utility to generate anchors for a multiple feature maps.
tfm.vision.anchor_generator.AnchorGenerator(
anchor_sizes, scales, aspect_ratios, strides, clip_boxes=False
)
Example:
anchor_gen = AnchorGenerator([32, 64], [.5, 1., 2.],
strides=[16, 32])
anchors = anchor_gen([512, 512, 3])
Args |
anchor_sizes
|
A list of int represents the anchor size for each scale. The
anchor height will be anchor_size / sqrt(aspect_ratio) , anchor width
will be anchor_size * sqrt(aspect_ratio) for each scale.
|
scales
|
A list/tuple, or a list/tuple of a list/tuple of positive
floats representing the actual anchor size to the base anchor_size .
|
aspect_ratios
|
A list/tuple, or a list/tuple of a list/tuple of positive
floats representing the ratio of anchor width to anchor height.
|
strides
|
A list/tuple of ints represent the anchor stride size between
center of anchors at each scale.
|
clip_boxes
|
Boolean to represents whether the anchor coordinates should be
clipped to the image size. Defaults to False .
|
Methods
__call__
View source
__call__(
image_size
)
Call self as a function.