yolov4ObjectDetector
Description
The yolov4ObjectDetector
object creates a you only look once
version 4 (YOLO v4) one-stage object detector for detecting objects in an image. Using this
object, you can:
Create a pretrained YOLO v4 object detector by using YOLO v4 deep learning networks trained on COCO dataset.
Create a custom YOLO v4 object detector by using any pretrained or untrained YOLO v4 deep learning network.
Creation
Syntax
Description
Pretrained YOLO v4 Object Detector
Custom YOLO v4 Object Detector
creates a pretrained YOLO v4 object detector and configures it to perform transfer
learning using a specified set of object classes and anchor boxes. For optimal results,
you must train the detector on new training images before performing detection. Use the
detector
= yolov4ObjectDetector(name
,classes
,aboxes
)trainYOLOv4ObjectDetector
function for training the detector.
creates an object detector by using the deep learning network
detector
= yolov4ObjectDetector(net
,classes
,aboxes
)net
.
If net
is a pretrained YOLO v4 deep learning network, the
function creates a pretrained YOLO v4 object detector. The classes
and aboxes
are values used for training the network.
If net
is an untrained YOLO v4 deep learning network, the
function creates a YOLO v4 object detector to use for training and inference.
classes
and aboxes
specify the object
classes and the anchor boxes, respectively, for training the YOLO v4 network.
Use the trainYOLOv4ObjectDetector
function to train the network before performing
object detection.
creates a YOLO v4 object detector by adding detection heads to a base network,
detector
= yolov4ObjectDetector(baseNet
,classes
,aboxes
,DetectionNetworkSource=layer
)baseNet
.
The function adds detection heads to the specified feature extraction layers
layer
in the base network. To specify the names of the feature
extraction layers, use the name-value argument
DetectionNetworkSource
=layer
.
If baseNet
is a pretrained deep learning network, the function
creates a YOLO v4 object detector and configures it to perform transfer learning with
the specified object classes and anchor boxes.
If baseNet
is an untrained deep learning network, the function
creates a YOLO v4 object detector and configures it for object detection.
classes
and aboxes
specify the object
classes and the anchor boxes, respectively, for training the YOLO v4 network.
You must train the detector on a training dataset before performing object
detection. Use the trainYOLOv4ObjectDetector
function for training the detector.
specifies one or more options using name-value arguments in addition to any combination
of input arguments from previous syntaxes. Use this syntax todetector
= yolov4ObjectDetector(___,Name=Value
)
Modify the detection network sources in a yolo v4 object detection network and train the network with different numbers of object classes, anchor boxes, or both. Specify the new detection network sources using the name-value argument
DetectionNetworkSource=
.layer
Set the
InputSize
andModelName
properties of the object detector by using name-value arguments in addition to any combination of input arguments from previous syntaxes. For example,InputSize=[224 224 3]
sets the size of the images used for training to[224 224 3]
.
Note
To use the pretrained YOLO v4 object detection networks trained on COCO dataset, you must install the Computer Vision Toolbox™ Model for YOLO v4 Object Detection. You can download and install the Computer Vision Toolbox Model for YOLO v4 Object Detection from Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons. To run this function, you will require the Deep Learning Toolbox™.
Input Arguments
Properties
Object Functions
detect | Detect objects using YOLO v4 object detector |