public class MultiBoxPrior
extends java.lang.Object
MultiBoxPrior
is the class that generates anchor boxes that act as priors for object
detection.
Object detection algorithms usually sample a large number of regions in the input image, determine whether these regions contain objects of interest, and adjust the edges of the regions so as to predict the ground-truth bounding box of the target more accurately. Different models may use different region sampling methods. These bounding boxes are also called anchor boxes.
MultiBoxPrior
generates these anchor boxes, based on the required sizes and aspect
ratios and returns an NDArray
of Shape
(1, Number of anchor
boxes, 4). Anchor boxes need not be generated separately for the each example in the batch. One
set of anchor boxes per batch is sufficient.
The number of anchor boxes generated depends on the number of sizes and aspect ratios. If the number of sizes is \(n\) and the number of ratios is \(m\), the total number of boxes generated per pixel is \(n + m - 1\).
Modifier and Type | Class and Description |
---|---|
static class |
MultiBoxPrior.Builder
The Builder to construct a
MultiBoxPrior object. |
Constructor and Description |
---|
MultiBoxPrior(MultiBoxPrior.Builder builder)
Creates a new instance of
MultiBoxPrior with the arguments from the given MultiBoxPrior.Builder . |
Modifier and Type | Method and Description |
---|---|
static MultiBoxPrior.Builder |
builder()
Creates a builder to build a
MultiBoxPrior . |
NDArray |
generateAnchorBoxes(NDArray input)
Generates the anchorBoxes array in the input's manager and device.
|
public MultiBoxPrior(MultiBoxPrior.Builder builder)
MultiBoxPrior
with the arguments from the given MultiBoxPrior.Builder
.builder
- the MultiBoxPrior.Builder
with the necessary argumentspublic NDArray generateAnchorBoxes(NDArray input)
input
- the input whose manager and device to put the generated boxes inpublic static MultiBoxPrior.Builder builder()
MultiBoxPrior
.