Main Content

anchorBoxLayer

(Removed) Create anchor box layer for object detection

Since R2020a

anchorBoxLayer function has been removed. Use the ssdObjectDetector object to specify the anchor boxes for training a SSD object detection network, instead.

Description

An anchor box layer stores anchor boxes for a feature map used in object detection networks.

Creation

Description

layer = anchorBoxLayer(anchorBoxes) creates an anchor box layer, specifying the size of the anchor boxes by using anchorBoxes. The anchorBoxes input sets the AnchorBoxes property.

layer = anchorBoxLayer(anchorBoxes,Name,Value) set properties of the anchor box layer by using one or more name-value arguments. Enclose each property name in quotes.

For example, anchorBoxLayer(anchorBoxes,'Name','anchorboxlayer') creates an anchor box layer with the name "anchorboxlayer" from anchor boxes specified by anchorBoxes.

example

Properties

expand all

Size of anchor boxes, specified as an M-by-2 matrix of M anchor boxes. Each row of the matrix is of the form [height width].

Layer name, specified as a character vector or string scalar. For Layer array input, the trainnet (Deep Learning Toolbox) and dlnetwork (Deep Learning Toolbox) functions automatically assign names to layers with the name "".

The AnchorBoxLayer object stores this property as a character vector.

Data Types: char | string

Examples

collapse all

Specify the size of four anchor boxes.

anchorBoxes = [50 50; 100 100; 50 100; 100 50];

Create an anchor box layer named "anchorboxlayer" and display the results.

layer = anchorBoxLayer(anchorBoxes,'Name','anchorboxlayer')
layer = 
  AnchorBoxLayer with properties:

           Name: 'anchorboxlayer'

   Hyperparameters
    AnchorBoxes: [4x2 double]

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2020a

expand all

R2024b: anchorBoxLayer function has been removed

anchorBoxLayer function has been removed. You can use the ssdObjectDetector object to specify the anchor boxes for training a SSD object detection network, instead.