Anchor class for anchor-based object detectors.
tfm.vision.anchor.Anchor(
min_level, max_level, num_scales, aspect_ratios, anchor_size, image_size
)
Args |
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.The image_size should be divided by the
largest feature stride 2^max_level.
|
Attributes |
anchors_per_location
|
|
multilevel_boxes
|
|
Methods
unpack_labels
View source
unpack_labels(
labels: tf.Tensor
) -> Dict[str, tf.Tensor]
Unpacks an array of labels into multi-scales labels.