42
#ifndef OPENCV_DNN_DNN_HPP
43
#define OPENCV_DNN_DNN_HPP
46
#include <opencv2/core.hpp>
47
#include "opencv2/core/async.hpp"
49
#include "../dnn/version.hpp"
51
#include <opencv2/dnn/dict.hpp>
55CV__DNN_INLINE_NS_BEGIN
59
typedef
std::vector<int> MatShape;
78
DNN_BACKEND_INFERENCE_ENGINE_NGRAPH = 1000000,
79
DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019,
91
DNN_TARGET_OPENCL_FP16,
100
CV_EXPORTS std::vector< std::pair<Backend, Target> > getAvailableBackends();
101
CV_EXPORTS_W std::vector<Target> getAvailableTargets(
dnn::Backend
be);
200
CV_PROP_RW std::vector<Mat> blobs;
210
CV_DEPRECATED_EXTERNAL
211
virtual
void
finalize(
const
std::vector<Mat*> &input, std::vector<Mat> &output);
228
CV_DEPRECATED_EXTERNAL
229
virtual
void
forward(std::vector<Mat*> &input, std::vector<Mat> &output, std::vector<Mat> &internals);
249
CV_DEPRECATED_EXTERNAL
250
void
finalize(
const
std::vector<Mat> &inputs, CV_OUT std::vector<Mat> &outputs);
256
CV_DEPRECATED std::vector<Mat> finalize(
const
std::vector<Mat> &inputs);
261
CV_DEPRECATED CV_WRAP
void
run(
const
std::vector<Mat> &inputs, CV_OUT std::vector<Mat> &outputs,
262
CV_IN_OUT std::vector<Mat> &internals);
274
CV_WRAP
virtual
int
outputNameToIndex(
const
String& outputName);
326
const
std::vector<Mat*> &inputs,
327
const
std::vector<Mat> &outputs,
376
virtual
bool
getMemoryShapes(
const
std::vector<MatShape> &inputs,
377
const
int
requiredOutputs,
378
std::vector<MatShape> &outputs,
379
std::vector<MatShape> &internals)
const;
381
virtual
int64 getFLOPS(
const
std::vector<MatShape> &inputs,
382
const
std::vector<MatShape> &outputs)
const
{CV_UNUSED(inputs); CV_UNUSED(outputs);
return
0;}
384
virtual
bool
updateMemoryShapes(
const
std::vector<MatShape> &inputs);
388
CV_PROP
int
preferableTarget;
406
class
CV_EXPORTS_W_SIMPLE
Net
419
CV_WRAP
static
Net
readFromModelOptimizer(
const
String& xml,
const
String& bin);
438
const
uchar* bufferWeightsPtr,
size_t
bufferWeightsSize);
441
CV_WRAP
bool
empty()
const;
447
CV_WRAP String dump();
452
CV_WRAP
void
dumpToFile(
const
String& path);
468
CV_WRAP
int
getLayerId(
const
String &layer);
470
CV_WRAP std::vector<String> getLayerNames()
const;
494
CV_WRAP
void
connect(String outPin, String inpPin);
502
void
connect(
int
outLayerId,
int
outNum,
int
inpLayerId,
int
inpNum);
511
CV_WRAP
void
setInputsNames(
const
std::vector<String> &inputBlobNames);
515
CV_WRAP
void
setInputShape(
const
String &inputName,
const
MatShape& shape);
522
CV_WRAP
Mat
forward(
const
String& outputName = String());
531
CV_WRAP
AsyncArray
forwardAsync(
const
String& outputName = String());
545
const
std::vector<String>& outBlobNames);
551
CV_WRAP_AS(forwardAndRetrieve)
void
forward(CV_OUT std::vector<std::vector<Mat> >& outputBlobs,
552
const
std::vector<String>& outBlobNames);
563
CV_WRAP
void
setHalideScheduler(
const
String& scheduler);
573
CV_WRAP
void
setPreferableBackend(
int
backendId);
592
CV_WRAP
void
setPreferableTarget(
int
targetId);
605
CV_WRAP
void
setInput(InputArray blob,
const
String& name =
"",
606
double
scalefactor = 1.0,
const
Scalar& mean =
Scalar());
616
CV_WRAP
void
setParam(
LayerId
layer,
int
numParam,
const
Mat
&blob);
627
CV_WRAP std::vector<int> getUnconnectedOutLayers()
const;
631
CV_WRAP std::vector<String> getUnconnectedOutLayersNames()
const;
642
CV_WRAP
void
getLayersShapes(
const
std::vector<MatShape>& netInputShapes,
643
CV_OUT std::vector<int>& layersIds,
644
CV_OUT std::vector<std::vector<MatShape> >& inLayersShapes,
645
CV_OUT std::vector<std::vector<MatShape> >& outLayersShapes)
const;
648
CV_WRAP
void
getLayersShapes(
const
MatShape& netInputShape,
649
CV_OUT std::vector<int>& layersIds,
650
CV_OUT std::vector<std::vector<MatShape> >& inLayersShapes,
651
CV_OUT std::vector<std::vector<MatShape> >& outLayersShapes)
const;
664
CV_OUT std::vector<MatShape>& inLayerShapes,
665
CV_OUT std::vector<MatShape>& outLayerShapes)
const;
670
CV_OUT std::vector<MatShape>& inLayerShapes,
671
CV_OUT std::vector<MatShape>& outLayerShapes)
const;
677
CV_WRAP int64 getFLOPS(
const
std::vector<MatShape>& netInputShapes)
const;
679
CV_WRAP int64 getFLOPS(
const
MatShape& netInputShape)
const;
681
CV_WRAP int64 getFLOPS(
const
int
layerId,
682
const
std::vector<MatShape>& netInputShapes)
const;
684
CV_WRAP int64 getFLOPS(
const
int
layerId,
685
const
MatShape& netInputShape)
const;
690
CV_WRAP
void
getLayerTypes(CV_OUT std::vector<String>& layersTypes)
const;
696
CV_WRAP
int
getLayersCount(
const
String& layerType)
const;
705
CV_OUT
size_t& weights, CV_OUT
size_t& blobs)
const;
707
CV_WRAP
void
getMemoryConsumption(
const
MatShape& netInputShape,
708
CV_OUT
size_t& weights, CV_OUT
size_t& blobs)
const;
710
CV_WRAP
void
getMemoryConsumption(
const
int
layerId,
711
const
std::vector<MatShape>& netInputShapes,
712
CV_OUT
size_t& weights, CV_OUT
size_t& blobs)
const;
714
CV_WRAP
void
getMemoryConsumption(
const
int
layerId,
715
const
MatShape& netInputShape,
716
CV_OUT
size_t& weights, CV_OUT
size_t& blobs)
const;
726
CV_OUT std::vector<int>& layerIds,
727
CV_OUT std::vector<size_t>& weights,
728
CV_OUT std::vector<size_t>& blobs)
const;
731
CV_OUT std::vector<int>& layerIds,
732
CV_OUT std::vector<size_t>& weights,
733
CV_OUT std::vector<size_t>& blobs)
const;
738
CV_WRAP
void
enableFusion(
bool
fusion);
748
CV_WRAP int64 getPerfProfile(CV_OUT std::vector<double>& timings);
769
const
std::vector<uchar>& bufferModel = std::vector<uchar>());
779
const
char
*bufferModel = NULL,
size_t
lenModel = 0);
794
const
std::vector<uchar>& bufferModel = std::vector<uchar>());
806
const
char
*bufferModel = NULL,
size_t
lenModel = 0);
823
const
std::vector<uchar>& bufferConfig = std::vector<uchar>());
834
const
char
*bufferConfig = NULL,
size_t
lenConfig = 0);
888
CV_EXPORTS_W
Net
readNet(
const
String& model,
const
String& config =
"",
const
String& framework =
"");
899
CV_EXPORTS_W
Net
readNet(
const
String& framework,
const
std::vector<uchar>& bufferModel,
900
const
std::vector<uchar>& bufferConfig = std::vector<uchar>());
938
const
uchar* bufferWeightsPtr,
size_t
bufferWeightsSize);
986
const
Scalar& mean =
Scalar(),
bool
swapRB=
false,
bool
crop=
false,
995
bool
swapRB=
false,
bool
crop=
false,
int
ddepth=CV_32F);
1024
double
scalefactor=1.0,
Size
size =
Size(),
1025
const
Scalar& mean =
Scalar(),
bool
swapRB=
false,
bool
crop=
false,
1052
const
std::vector<String>& layersTypes = std::vector<String>());
1072
CV_EXPORTS
void
NMSBoxes(
const
std::vector<Rect>& bboxes,
const
std::vector<float>& scores,
1073
const
float
score_threshold,
const
float
nms_threshold,
1074
CV_OUT std::vector<int>& indices,
1075
const
float
eta = 1.f,
const
int
top_k = 0);
1077
CV_EXPORTS_W
void
NMSBoxes(
const
std::vector<Rect2d>& bboxes,
const
std::vector<float>& scores,
1078
const
float
score_threshold,
const
float
nms_threshold,
1079
CV_OUT std::vector<int>& indices,
1080
const
float
eta = 1.f,
const
int
top_k = 0);
1082
CV_EXPORTS_AS(NMSBoxesRotated)
void
NMSBoxes(
const
std::vector<RotatedRect>& bboxes,
const
std::vector<float>& scores,
1083
const
float
score_threshold,
const
float
nms_threshold,
1084
CV_OUT std::vector<int>& indices,
1085
const
float
eta = 1.f,
const
int
top_k = 0);
1097
CV_DEPRECATED_EXTERNAL
1111
CV_WRAP
Model(
const
String& model,
const
String& config =
"");
1140
CV_WRAP
Model& setInputScale(
double
scale);
1150
CV_WRAP
Model& setInputSwapRB(
bool
swapRB);
1160
CV_WRAP
void
setInputParams(
double
scale = 1.0,
const
Size& size =
Size(),
1161
const
Scalar& mean =
Scalar(),
bool
swapRB =
false,
bool
crop =
false);
1181
CV_DEPRECATED_EXTERNAL
1182
operator
Net&()
const
{
return
getNetwork_(); }
1185
Net& getNetwork_()
const;
1186
inline
Net& getNetwork_() {
return
const_cast<
const
Model*
>(
this)->getNetwork_(); }
1189
inline
Impl* getImpl()
const
{
return
impl.get(); }
1190
inline
Impl& getImplRef()
const
{
CV_DbgAssert(impl);
return
*impl.get(); }
1224
CV_WRAP
void
classify(InputArray frame, CV_OUT
int& classId, CV_OUT
float& conf);
1256
CV_WRAP std::vector<Point2f> estimate(InputArray frame,
float
thresh=0.5);
1313
CV_DEPRECATED_EXTERNAL
1328
CV_WRAP
bool
getNmsAcrossClasses();
1338
CV_WRAP
void
detect(InputArray frame, CV_OUT std::vector<int>& classIds,
1339
CV_OUT std::vector<float>& confidences, CV_OUT std::vector<Rect>& boxes,
1340
float
confThreshold = 0.5f,
float
nmsThreshold = 0.0f);
1354
CV_DEPRECATED_EXTERNAL
1417
void
recognize(InputArray frame, InputArrayOfArrays roiRects, CV_OUT std::vector<std::string>& results)
const;
1426
CV_DEPRECATED_EXTERNAL
1452
CV_OUT std::vector< std::vector<Point> >& detections,
1453
CV_OUT std::vector<float>& confidences
1460
CV_OUT std::vector< std::vector<Point> >& detections
1478
CV_OUT std::vector<cv::RotatedRect>& detections,
1479
CV_OUT std::vector<float>& confidences
1486
CV_OUT std::vector<cv::RotatedRect>& detections
1499
CV_DEPRECATED_EXTERNAL
1560
CV_DEPRECATED_EXTERNAL
1580
CV_WRAP
float
getBinaryThreshold()
const;
1583
CV_WRAP
float
getPolygonThreshold()
const;
1586
CV_WRAP
double
getUnclipRatio()
const;
1589
CV_WRAP
int
getMaxCandidates()
const;
1593CV__DNN_INLINE_NS_END
1597
#include <opencv2/dnn/layer.hpp>
1598
#include <opencv2/dnn/dnn.inl.hpp>
1601
#include <opencv2/dnn/utils/inference_engine.hpp>
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition:
mat.hpp:295
This is a base class for all more or less complex algorithms in OpenCV
Definition:
core.hpp:3091
Returns result of asynchronous operations
Definition:
async.hpp:32
n-dimensional dense array class
Definition:
mat.hpp:802
Template class for specifying the size of an image or rectangle.
Definition:
core/types.hpp:316
Definition:
all_layers.hpp:425
Derivatives of this class encapsulates functions of certain backends.
Definition:
dnn/dnn.hpp:134
virtual ~BackendNode()
Virtual destructor to make polymorphism.
int backendId
Backend identifier.
Definition:
dnn/dnn.hpp:140
Derivatives of this class wraps cv::Mat for different backends and targets.
Definition:
dnn/dnn.hpp:147
virtual void copyToHost()=0
Transfer data to CPU host memory.
virtual ~BackendWrapper()
Virtual destructor to make polymorphism.
virtual void setHostDirty()=0
Indicate that an actual data is on CPU.
BackendWrapper(int targetId, const cv::Mat &m)
Wrap cv::Mat for specific backend and target.
int backendId
Backend identifier.
Definition:
dnn/dnn.hpp:184
BackendWrapper(const Ptr< BackendWrapper > &base, const MatShape &shape)
Make wrapper for reused cv::Mat.
int targetId
Target identifier.
Definition:
dnn/dnn.hpp:185
This class represents high-level API for classification models.
Definition:
dnn/dnn.hpp:1202
std::pair< int, float > classify(InputArray frame)
Given the input frame, create input blob, run net and return top-1 prediction.
This class represents high-level API for object detection networks.
Definition:
dnn/dnn.hpp:1297
This class implements name-value dictionary, values are instances of DictValue.
Definition:
dict.hpp:115
This class represents high-level API for keypoints models
Definition:
dnn/dnn.hpp:1234
This interface class allows to build new Layers - are building blocks of networks.
Definition:
dnn/dnn.hpp:196
virtual bool supportBackend(int backendId)
Ask layer if it support specific backend for doing computations.
virtual CV_DEPRECATED_EXTERNAL void finalize(const std::vector< Mat * > &input, std::vector< Mat > &output)
Computes and sets internal parameters according to inputs, outputs and blobs.
virtual bool setActivation(const Ptr< ActivationLayer > &layer)
Tries to attach to the layer the subsequent activation layer, i.e. do the layer fusion in a partial c...
virtual void getScaleShift(Mat &scale, Mat &shift) const
Returns parameters of layers with channel-wise multiplication and addition.
virtual void applyHalideScheduler(Ptr< BackendNode > &node, const std::vector< Mat * > &inputs, const std::vector< Mat > &outputs, int targetId) const
Automatic Halide scheduling based on layer hyper-parameters.
virtual CV_DEPRECATED_EXTERNAL void forward(std::vector< Mat * > &input, std::vector< Mat > &output, std::vector< Mat > &internals)
Given the input blobs, computes the output blobs.
virtual Ptr< BackendNode > tryAttach(const Ptr< BackendNode > &node)
Implement layers fusing.
virtual int inputNameToIndex(String inputName)
Returns index of input blob into the input array.
virtual Ptr< BackendNode > initCUDA(void *context, const std::vector< Ptr< BackendWrapper > > &inputs, const std::vector< Ptr< BackendWrapper > > &outputs)
Returns a CUDA backend node
virtual void forward(InputArrayOfArrays inputs, OutputArrayOfArrays outputs, OutputArrayOfArrays internals)
Given the input blobs, computes the output blobs.
virtual Ptr< BackendNode > initHalide(const std::vector< Ptr< BackendWrapper > > &inputs)
Returns Halide backend node.
void setParamsFrom(const LayerParams ¶ms)
Initializes only name, type and blobs fields.
void forward_fallback(InputArrayOfArrays inputs, OutputArrayOfArrays outputs, OutputArrayOfArrays internals)
Given the input blobs, computes the output blobs.
virtual void unsetAttached()
"Deattaches" all the layers, attached to particular layer.
virtual bool tryFuse(Ptr< Layer > &top)
Try to fuse current layer with a next one
Layer(const LayerParams ¶ms)
Initializes only name, type and blobs fields.
CV_DEPRECATED_EXTERNAL void finalize(const std::vector< Mat > &inputs, CV_OUT std::vector< Mat > &outputs)
これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。
This class provides all data needed to initialize layer.
Definition:
dnn/dnn.hpp:121
std::vector< Mat > blobs
List of learned parameters stored as blobs.
Definition:
dnn/dnn.hpp:124
String type
Type name which was used for creating layer by layer factory (optional).
Definition:
dnn/dnn.hpp:127
String name
Name of the layer instance (optional, can be used internal purposes).
Definition:
dnn/dnn.hpp:126
This class is presented high-level API for neural networks.
Definition:
dnn/dnn.hpp:1095
CV_WRAP Model & setInputSize(int width, int height)
Definition:
dnn/dnn.hpp:1130
This class allows to create and manipulate comprehensive artificial neural networks.
Definition:
dnn/dnn.hpp:407
void getMemoryConsumption(const MatShape &netInputShape, CV_OUT std::vector< int > &layerIds, CV_OUT std::vector< size_t > &weights, CV_OUT std::vector< size_t > &blobs) const
int addLayer(const String &name, const String &type, LayerParams ¶ms)
Adds new layer to the net.
void connect(int outLayerId, int outNum, int inpLayerId, int inpNum)
Connects #outNum output of the first layer to #inNum input of the second layer.
void getLayerShapes(const MatShape &netInputShape, const int layerId, CV_OUT std::vector< MatShape > &inLayerShapes, CV_OUT std::vector< MatShape > &outLayerShapes) const
Returns input and output shapes for layer with specified id in loaded model; preliminary inferencing ...
void getMemoryConsumption(const std::vector< MatShape > &netInputShapes, CV_OUT size_t &weights, CV_OUT size_t &blobs) const
Computes bytes number which are required to store all weights and intermediate blobs for model.
DictValue LayerId
Container for strings and integers.
Definition:
dnn/dnn.hpp:473
int addLayerToPrev(const String &name, const String &type, LayerParams ¶ms)
Adds new layer and connects its first input to the first output of previously added layer.
void getMemoryConsumption(const std::vector< MatShape > &netInputShapes, CV_OUT std::vector< int > &layerIds, CV_OUT std::vector< size_t > &weights, CV_OUT std::vector< size_t > &blobs) const
Computes bytes number which are required to store all weights and intermediate blobs for each layer.
void getLayerShapes(const std::vector< MatShape > &netInputShapes, const int layerId, CV_OUT std::vector< MatShape > &inLayerShapes, CV_OUT std::vector< MatShape > &outLayerShapes) const
static CV_WRAP Net readFromModelOptimizer(const std::vector< uchar > &bufferModelConfig, const std::vector< uchar > &bufferWeights)
Create a network from Intel's Model Optimizer in-memory buffers with intermediate representation (IR)...
static Net readFromModelOptimizer(const uchar *bufferModelConfigPtr, size_t bufferModelConfigSize, const uchar *bufferWeightsPtr, size_t bufferWeightsSize)
Create a network from Intel's Model Optimizer in-memory buffers with intermediate representation (IR)...
std::vector< Ptr< Layer > > getLayerInputs(LayerId layerId)
Returns pointers to input layers of specific layer.
This class represents high-level API for segmentation models
Definition:
dnn/dnn.hpp:1266
This class represents high-level API for text detection DL networks compatible with DB model.
Definition:
dnn/dnn.hpp:1558
CV_WRAP TextDetectionModel_DB(const std::string &model, const std::string &config="")
Create text detection model from network represented in one of the supported formats....
Definition:
dnn/dnn.hpp:1576
This class represents high-level API for text detection DL networks compatible with EAST model.
Definition:
dnn/dnn.hpp:1497
CV_WRAP TextDetectionModel_EAST(const std::string &model, const std::string &config="")
Create text detection model from network represented in one of the supported formats....
Definition:
dnn/dnn.hpp:1515
CV_WRAP float getConfidenceThreshold() const
Get the detection confidence threshold
CV_WRAP float getNMSThreshold() const
Get the detection confidence threshold
CV_WRAP TextDetectionModel_EAST & setNMSThreshold(float nmsThreshold)
Set the detection NMS filter threshold
CV_WRAP TextDetectionModel_EAST & setConfidenceThreshold(float confThreshold)
Set the detection confidence threshold
Base class for text detection networks
Definition:
dnn/dnn.hpp:1424
CV_WRAP void detect(InputArray frame, CV_OUT std::vector< std::vector< Point > > &detections) const
CV_WRAP void detectTextRectangles(InputArray frame, CV_OUT std::vector< cv::RotatedRect > &detections, CV_OUT std::vector< float > &confidences) const
Performs detection
CV_WRAP void detect(InputArray frame, CV_OUT std::vector< std::vector< Point > > &detections, CV_OUT std::vector< float > &confidences) const
Performs detection
CV_WRAP void detectTextRectangles(InputArray frame, CV_OUT std::vector< cv::RotatedRect > &detections) const
This class represents high-level API for text recognition networks.
Definition:
dnn/dnn.hpp:1352
CV_WRAP const std::vector< std::string > & getVocabulary() const
Get the vocabulary for recognition.
CV_WRAP std::string recognize(InputArray frame) const
Given the input frame, create input blob, run net and return recognition result
CV_WRAP const std::string & getDecodeType() const
Get the decoding method
CV_WRAP TextRecognitionModel & setVocabulary(const std::vector< std::string > &vocabulary)
Set the vocabulary for recognition.
CV_WRAP TextRecognitionModel(const std::string &model, const std::string &config="")
Create text recognition model from network represented in one of the supported formats Call setDecode...
Definition:
dnn/dnn.hpp:1371
CV_WRAP void recognize(InputArray frame, InputArrayOfArrays roiRects, CV_OUT std::vector< std::string > &results) const
Given the input frame, create input blob, run net and return recognition result
CV_WRAP TextRecognitionModel & setDecodeType(const std::string &decodeType)
Set the decoding method of translating the network output into string
CV_EXPORTS_AS(calibrateCameraExtended) double calibrateCamera(InputArrayOfArrays objectPoints
Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern.
#define CV_DbgAssert(expr)
Definition:
base.hpp:375
CV_EXPORTS void blobFromImages(InputArrayOfArrays images, OutputArray blob, double scalefactor=1.0, Size size=Size(), const Scalar &mean=Scalar(), bool swapRB=false, bool crop=false, int ddepth=CV_32F)
Creates 4-dimensional blob from series of images.
CV_EXPORTS_W Net readNetFromONNX(const std::vector< uchar > &buffer)
Reads a network model from ONNX in-memory buffer.
CV_EXPORTS_W Net readNetFromTorch(const String &model, bool isBinary=true, bool evaluate=true)
Reads a network model stored in Torch7 framework's format.
Backend
Enum of computation backends supported by layers.
Definition:
dnn/dnn.hpp:66
CV_EXPORTS void NMSBoxes(const std::vector< Rect > &bboxes, const std::vector< float > &scores, const float score_threshold, const float nms_threshold, CV_OUT std::vector< int > &indices, const float eta=1.f, const int top_k=0)
Performs non maximum suppression given boxes and corresponding scores.
CV_EXPORTS_W Mat readTorchBlob(const String &filename, bool isBinary=true)
Loads blob which was serialized as torch.Tensor object of Torch7 framework.
CV_EXPORTS void blobFromImage(InputArray image, OutputArray blob, double scalefactor=1.0, const Size &size=Size(), const Scalar &mean=Scalar(), bool swapRB=false, bool crop=false, int ddepth=CV_32F)
Creates 4-dimensional blob from image.
CV_EXPORTS Net readNetFromModelOptimizer(const uchar *bufferModelConfigPtr, size_t bufferModelConfigSize, const uchar *bufferWeightsPtr, size_t bufferWeightsSize)
Load a network from Intel's Model Optimizer intermediate representation.
Target
Enum of target devices for computations.
Definition:
dnn/dnn.hpp:88
CV_EXPORTS_W Mat readTensorFromONNX(const String &path)
Creates blob from .pb file.
CV_EXPORTS_W void imagesFromBlob(const cv::Mat &blob_, OutputArrayOfArrays images_)
Parse a 4D blob and output the images it contains as 2D arrays through a simpler data structure (std:...
CV_EXPORTS void enableModelDiagnostics(bool isDiagnosticsMode)
Enables detailed logging of the DNN model loading with CV DNN API.
CV_EXPORTS_W void writeTextGraph(const String &model, const String &output)
Create a text representation for a binary network stored in protocol buffer format.
CV_EXPORTS Net readNetFromCaffe(const char *bufferProto, size_t lenProto, const char *bufferModel=NULL, size_t lenModel=0)
Reads a network model stored in Caffe model in memory.
CV_EXPORTS_W void shrinkCaffeModel(const String &src, const String &dst, const std::vector< String > &layersTypes=std::vector< String >())
Convert all weights of Caffe network to half precision floating point.
CV_EXPORTS_W Net readNet(const String &framework, const std::vector< uchar > &bufferModel, const std::vector< uchar > &bufferConfig=std::vector< uchar >())
Read deep learning network represented in one of the supported formats.
CV_EXPORTS Net readNetFromDarknet(const char *bufferCfg, size_t lenCfg, const char *bufferModel=NULL, size_t lenModel=0)
Reads a network model stored in Darknet model files.
CV_EXPORTS Net readNetFromTensorflow(const char *bufferModel, size_t lenModel, const char *bufferConfig=NULL, size_t lenConfig=0)
Reads a network model stored in TensorFlow framework's format.
@ DNN_BACKEND_DEFAULT
Definition:
dnn/dnn.hpp:70
@ DNN_BACKEND_INFERENCE_ENGINE
Definition:
dnn/dnn.hpp:72
@ DNN_TARGET_FPGA
FPGA device with CPU fallbacks using Inference Engine's Heterogeneous plugin.
Definition:
dnn/dnn.hpp:94
CV_EXPORTS CV_WRAP_AS(goodFeaturesToTrackWithQuality) void goodFeaturesToTrack(InputArray image
Same as above, but returns also quality measure of the detected corners.
"black box" representation of the file storage associated with a file on disk.
Definition:
aruco.hpp:75
Definition:
cvstd_wrapper.hpp:74
This struct stores the scalar value (or array) of one of the following type: double,...
Definition:
dict.hpp:61