cv.Net/Net - MATLAB File Help |
Constructor and importer of trained serialized models from different dnn-frameworks
net = cv.Net()
net = cv.Net('Caffe', prototxt)
net = cv.Net('Caffe', prototxt, caffeModel)
net = cv.Net('Tensorflow', modelmodel)
net = cv.Net('Tensorflow', model, config)
net = cv.Net('Torch', filename)
net = cv.Net('Torch', filename, isBinary)
net = cv.Net('Darknet', cfgFile)
net = cv.Net('Darknet', cfgFile, darknetModel)
.prototxt
file with text
description of the network architecture..caffemodel
file with
learned network. Empty by default..pb
file with binary protobuf
description of the network architecture. Binary serialized
TensorFlow graph includes weights..pbtxt
file that contains
text graph definition in protobuf format. Resulting net is
built by text graph using weights from a binary one. This is
more flexible than binary format and may be used to build the
network using binary format only as a weights storage. This
approach is similar to Caffe's .prorotxt
and .caffemodel
.torch.save()
function..cfg
file with text description of
the network architecture..weights
file with
learned network.The first variant creates an empty network.
The second variant reads a network model stored in Caffe framework's format.
The third variant reads a network model stored in TensorFlow framework's format.
The fourth variant reads a network model stored in Torch7 framework's format.
The fifth variant reads a network model stored in Darknet model files.
The importers first create a net, add loaded layers into it, and set connections between them.
NOTE: ASCII mode of Torch serializer is more preferable, because
binary mode extensively use long
type of C language, which has
various bit-length on different systems.
The loading file must contain serialized
nn.Module
object with importing network. Try to eliminate a custom objects
from serialazing data to avoid importing errors.
List of supported layers (i.e. object instances derived from
Torch nn.Module
class):
nn.Sequential
nn.Parallel
nn.Concat
nn.Linear
nn.SpatialConvolution
nn.SpatialMaxPooling
, nn.SpatialAveragePooling
nn.ReLU
, nn.TanH
, nn.Sigmoid
nn.Reshape
nn.SoftMax
, nn.LogSoftMax
Also some equivalents of these classes from cunn, cudnn, and fbcunn may be successfully imported.