coder.loadDeepLearningNetwork
Load deep learning network model
Syntax
Description
loads a pretrained deep learning network or detector saved in the MAT file. The
net = coder.loadDeepLearningNetwork(filename)filename argument must be a valid MAT file that exists on
the MATLAB® path and contain only one supported network or detector object.
coder.loadDeepLearningNetwork supports loading these deep learning network and
detector objects for code generation:
Deep Learning Networks
dlnetwork(Deep Learning Toolbox)SeriesNetwork(Deep Learning Toolbox)DAGNetwork(Deep Learning Toolbox)
Detectors
yolov2ObjectDetector(Computer Vision Toolbox)ssdObjectDetector(Computer Vision Toolbox)yoloxObjectDetector(Computer Vision Toolbox)fastFlowAnomalyDetector(Computer Vision Toolbox)fcddAnomalyDetector(Computer Vision Toolbox)patchCoreAnomalyDetector(Computer Vision Toolbox)
calls a function that returns a pretrained deep learning network or detector object.
net = coder.loadDeepLearningNetwork(functionname)functionname must be the name of a function existing on the
MATLAB path that returns the supported deep learning network or detector
objects.
is the same as net = coder.loadDeepLearningNetwork(___,network_name)net = coder.loadDeepLearningNetwork(filename) with
the option to name the C++ class generated from the network.
network_name is a descriptive name for the network object
saved in the MAT file or pointed to by the function. The network name must be a
char type that is a valid identifier in C++.
Use this function when generating code from a network object inference. This function generates a C++ class from this network. The class name is derived from the MAT file name or the function name.
Note
The input argument of coder.loadDeepLearningNetwork
must be a compile-time constant.
Examples
Input Arguments
Output Arguments
Limitations
coder.loadDeepLearningNetworkdoes not support loading MAT files that have multiple networks or multiple object detectors.The locale setting determines the 8-bit ASCII codeset that the code generator uses to represent characters. Therefore, the use of non-ASCII characters in file, folder, or network names can result in errors. For more information, see Encoding of Characters in Code Generation.