tfm.vision.anchor_generator.AnchorGenerator

Utility to generate anchors for a multiple feature maps.

Example:

anchor_gen = AnchorGenerator([32, 64], [.5, 1., 2.],
  strides=[16, 32])
anchors = anchor_gen([512, 512, 3])

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 self as a function.