dnn.hpp File Reference


#include <vector>
#include < opencv2/core.hpp >
#include " opencv2/core/async.hpp "
#include " ../dnn/version.hpp "
#include < opencv2/dnn/dict.hpp >
#include < opencv2/dnn/layer.hpp >
#include <opencv2/dnn/dnn.inl.hpp>
#include < opencv2/dnn/utils/inference_engine.hpp >

class   cv::dnn::BackendNode
  Derivatives of this class encapsulates functions of certain backends. 更多...
 
class   cv::dnn::BackendWrapper
  Derivatives of this class wraps cv::Mat for different backends and targets. 更多...
 
class   cv::dnn::ClassificationModel
  This class represents high-level API for classification models. 更多...
 
class   cv::dnn::DetectionModel
  This class represents high-level API for object detection networks. 更多...
 
class   cv::dnn::KeypointsModel
  This class represents high-level API for keypoints models. 更多...
 
class   cv::dnn::Layer
  This interface class allows to build new Layers - are building blocks of networks. 更多...
 
class   cv::dnn::LayerParams
  This class provides all data needed to initialize layer. 更多...
 
class   cv::dnn::Model
  This class is presented high-level API for neural networks. 更多...
 
class   cv::dnn::Net
  This class allows to create and manipulate comprehensive artificial neural networks. 更多...
 
class   cv::dnn::SegmentationModel
  This class represents high-level API for segmentation models. 更多...
 

名称空间

  cv
  "black box" representation of the file storage associated with a file on disk.
 
  cv::dnn
 

Typedefs

typedef std::vector< int >  cv::dnn::MatShape
 

枚举

enum   cv::dnn::Backend {
   cv::dnn::DNN_BACKEND_DEFAULT = 0,
   cv::dnn::DNN_BACKEND_HALIDE ,
   cv::dnn::DNN_BACKEND_INFERENCE_ENGINE ,
   cv::dnn::DNN_BACKEND_OPENCV ,
   cv::dnn::DNN_BACKEND_VKCOM ,
   cv::dnn::DNN_BACKEND_CUDA
}
  Enum of computation backends supported by layers. 更多...
 
enum   cv::dnn::Target {
   cv::dnn::DNN_TARGET_CPU ,
   cv::dnn::DNN_TARGET_OPENCL ,
   cv::dnn::DNN_TARGET_OPENCL_FP16 ,
   cv::dnn::DNN_TARGET_MYRIAD ,
   cv::dnn::DNN_TARGET_VULKAN ,
   cv::dnn::DNN_TARGET_FPGA ,
   cv::dnn::DNN_TARGET_CUDA ,
   cv::dnn::DNN_TARGET_CUDA_FP16
}
  Enum of target devices for computations. 更多...
 

函数

Mat  cv::dnn::blobFromImage (InputArray image, 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. Optionally resizes and crops image from center, subtract mean values, scales values by scalefactor , swap Blue and Red channels. 更多...
 
void  cv::dnn::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. 更多...
 
Mat  cv::dnn::blobFromImages (InputArrayOfArrays images, 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. Optionally resizes and crops images from center, subtract mean values, scales values by scalefactor , swap Blue and Red channels. 更多...
 
void  cv::dnn::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. 更多...
 
std::vector< std::pair< Backend, Target > >  cv::dnn::getAvailableBackends ()
 
std::vector< Target >  cv::dnn::getAvailableTargets (Backend be)
 
void  cv::dnn::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::vector<cv::Mat>). 更多...
 
void  cv::dnn::NMSBoxes (const std::vector< Rect > &bboxes, const std::vector< float > &scores, const float score_threshold, const float nms_threshold, std::vector< int > &indices, const float eta=1.f, const int top_k=0)
  Performs non maximum suppression given boxes and corresponding scores. 更多...
 
void  cv::dnn::NMSBoxes (const std::vector< Rect2d > &bboxes, const std::vector< float > &scores, const float score_threshold, const float nms_threshold, std::vector< int > &indices, const float eta=1.f, const int top_k=0)
 
void  cv::dnn::NMSBoxes (const std::vector< RotatedRect > &bboxes, const std::vector< float > &scores, const float score_threshold, const float nms_threshold, std::vector< int > &indices, const float eta=1.f, const int top_k=0)
 
Net  cv::dnn::readNet (const String &model, const String &config="", const String &framework="")
  Read deep learning network represented in one of the supported formats. 更多...
 
Net  cv::dnn::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. 更多...
 
Net  cv::dnn::readNetFromCaffe (const String &prototxt, const String &caffeModel=String())
  Reads a network model stored in Caffe framework's format. 更多...
 
Net  cv::dnn::readNetFromCaffe (const std::vector< uchar > &bufferProto, const std::vector< uchar > &bufferModel=std::vector< uchar >())
  Reads a network model stored in Caffe model in memory. 更多...
 
Net  cv::dnn::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. 更多...
 
Net  cv::dnn::readNetFromDarknet (const String &cfgFile, const String &darknetModel=String())
  Reads a network model stored in Darknet model files. 更多...
 
Net  cv::dnn::readNetFromDarknet (const std::vector< uchar > &bufferCfg, const std::vector< uchar > &bufferModel=std::vector< uchar >())
  Reads a network model stored in Darknet model files. 更多...
 
Net  cv::dnn::readNetFromDarknet (const char *bufferCfg, size_t lenCfg, const char *bufferModel=NULL, size_t lenModel=0)
  Reads a network model stored in Darknet model files. 更多...
 
Net  cv::dnn::readNetFromModelOptimizer (const String &xml, const String &bin)
  Load a network from Intel's Model Optimizer intermediate representation. 更多...
 
Net  cv::dnn::readNetFromModelOptimizer (const std::vector< uchar > &bufferModelConfig, const std::vector< uchar > &bufferWeights)
  Load a network from Intel's Model Optimizer intermediate representation. 更多...
 
Net  cv::dnn::readNetFromModelOptimizer (const uchar *bufferModelConfigPtr, size_t bufferModelConfigSize, const uchar *bufferWeightsPtr, size_t bufferWeightsSize)
  Load a network from Intel's Model Optimizer intermediate representation. 更多...
 
Net  cv::dnn::readNetFromONNX (const String &onnxFile)
  Reads a network model ONNX . 更多...
 
Net  cv::dnn::readNetFromONNX (const char *buffer, size_t sizeBuffer)
  Reads a network model from ONNX in-memory buffer. 更多...
 
Net  cv::dnn::readNetFromONNX (const std::vector< uchar > &buffer)
  Reads a network model from ONNX in-memory buffer. 更多...
 
Net  cv::dnn::readNetFromTensorflow (const String &model, const String &config=String())
  Reads a network model stored in TensorFlow framework's format. 更多...
 
Net  cv::dnn::readNetFromTensorflow (const std::vector< uchar > &bufferModel, const std::vector< uchar > &bufferConfig=std::vector< uchar >())
  Reads a network model stored in TensorFlow framework's format. 更多...
 
Net  cv::dnn::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. 更多...
 
Net  cv::dnn::readNetFromTorch (const String &model, bool isBinary=true, bool evaluate=true)
  Reads a network model stored in Torch7 framework's format. 更多...
 
Mat  cv::dnn::readTensorFromONNX (const String &path)
  Creates blob from .pb file. 更多...
 
Mat  cv::dnn::readTorchBlob (const String &filename, bool isBinary=true)
  Loads blob which was serialized as torch.Tensor object of Torch7 framework. 更多...
 
void  cv::dnn::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. 更多...
 
void  cv::dnn::writeTextGraph (const String &model, const String &output)
  Create a text representation for a binary network stored in protocol buffer format. 更多...