Main Content

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 only look 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

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.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Properties

expand all

Layer name, specified as a character vector or a string scalar. For Layer array input, the trainNetwork, assembleNetwork, layerGraph, and dlnetwork functions automatically assign names to layers with Name set to ''.

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.

This property is read-only.

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

Data Types: double

This property is read-only.

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

Data Types: cell

This property is read-only.

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

Data Types: double

This property is read-only.

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