yolov2TransformLayer

Create transform layer for YOLO v2 object detection network

Description

The yolov2TransformLayer function creates a YOLOv2TransformLayer object, which represents the transform layer for you look only once version 2 (YOLO v2) object detection network. The transform layer in YOLO v2 object detection network improves the stability of the network by constraining the location predictions. The transform layer extracts activations of the last convolutional layer and transforms the bounding box predictions to fall within the bounds of the ground truth.

Creation

Syntax

layer = yolov2TransformLayer(numAnchorBoxes)
layer = yolov2TransformLayer(numAnchorBoxes,Name,Value)

Description

example

layer = yolov2TransformLayer(numAnchorBoxes) creates the transform layer for YOLO v2 object detection network.

example

layer = yolov2TransformLayer(numAnchorBoxes,Name,Value) sets the Name property using a name-value pair. Enclose the property name in single quotes. For example, yolov2TransformLayer('Name','yolo_Transform') creates a transform layer with the name 'yolo_Transform'.

Input Arguments

expand all

Number of anchor boxes used for training, specified as a positive integer. This input sets the NumAnchorBoxes property of the transform layer.

Properties

expand all

Layer name, specified as a character vector or a string scalar. To include a layer in a layer graph, you must specify a nonempty unique layer name. If you train a series network with the layer and Name is set to '', then the software automatically assigns a name to the layer at training time.

Data Types: char | string

This property is read-only.

Number of anchor boxes used for training, specified as a positive integer. This property is set by the input numAnchorBoxes.

Number of inputs of the layer. This layer accepts a single input only.

Data Types: double

Input names of the layer. This layer accepts a single input only.

Data Types: cell

Number of outputs of the layer. This layer has a single output only.

Data Types: double

Output names of the layer. This layer has a single output only.

Data Types: cell

Examples

collapse all

Specify the number of anchor boxes.

numAnchorBoxes = 5;

Create a YOLO v2 transform layer with the name "yolo_Transform".

layer = yolov2TransformLayer(numAnchorBoxes,'Name','yolo_Transform');

Inspect the properties of the YOLO v2 transform layer.

layer
layer = 
  YOLOv2TransformLayer with properties:

              Name: 'yolo_Transform'

   Hyperparameters
    NumAnchorBoxes: 5

References

[1] Joseph. R, S. K. Divvala, R. B. Girshick, and F. Ali. "You Only Look Once: Unified, Real-Time Object Detection." In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 779–788. Las Vegas, NV: CVPR, 2016.

[2] Joseph. R and F. Ali. "YOLO 9000: Better, Faster, Stronger." In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 6517–6525. Honolulu, HI: CVPR, 2017.

Extended Capabilities

Introduced in R2019a