cv::dnn::KeypointsModel Class Reference DNN (深度神经网络) 模块


This class represents high-level API for keypoints models. 更多...

#include <opencv2/dnn/dnn.hpp>

Inheritance diagram for cv::dnn::KeypointsModel:
cv::dnn::Model cv::dnn::Net

Public Member Functions

KeypointsModel (const 字符串 &model, const 字符串 &config="")
Create keypoints model from network represented in one of the supported formats. An order of model and config arguments does not matter. 更多...
KeypointsModel (const Net &network)
Create model from deep learning network. 更多...
std::vector< Point2f > estimate ( InputArray frame, float thresh=0.5)
Given the input frame, create input blob, run net. 更多...
- Public Member Functions inherited from cv::dnn::Model
Model ()
Default constructor. 更多...
Model (const 字符串 &model, const 字符串 &config="")
Create model from deep learning network represented in one of the supported formats. An order of model and config arguments does not matter. 更多...
Model (const Net &network)
Create model from deep learning network. 更多...
void predict ( InputArray frame, OutputArrayOfArrays outs)
Given the input frame, create input blob, run net and return the output blobs . 更多...
Model & setInputCrop (bool crop)
Set flag crop for frame. 更多...
Model & setInputMean (const Scalar & mean )
Set mean value for frame. 更多...
void setInputParams (double scale=1.0, const Size &size= Size (), const Scalar & mean = Scalar (), bool swapRB=false, bool crop=false)
Set preprocessing parameters for frame. 更多...
Model & setInputScale (double scale)
Set scalefactor value for frame. 更多...
Model & setInputSize (const Size &size)
Set input size for frame. 更多...
Model & setInputSize (int width, int height)
Set input size for frame. 更多...
Model & setInputSwapRB (bool swapRB)
Set flag swapRB for frame. 更多...
- Public Member Functions inherited from cv::dnn::Net
Net ()
Default constructor. 更多...
~Net ()
Destructor frees the net only if there aren't references to the net anymore. 更多...
int addLayer (const 字符串 &name, const 字符串 &type, LayerParams &params)
Adds new layer to the net. 更多...
int addLayerToPrev (const 字符串 &name, const 字符串 &type, LayerParams &params)
Adds new layer and connects its first input to the first output of previously added layer. 更多...
void connect ( 字符串 outPin, 字符串 inpPin)
Connects output of the first layer to input of the second layer. 更多...
void connect (int outLayerId, int outNum, int inpLayerId, int inpNum)
Connects # outNum output of the first layer to # inNum input of the second layer. 更多...
字符串 dump ()
Dump net to String. 更多...
void dumpToFile (const 字符串 &path)
Dump net structure, hyperparameters, backend, target and fusion to dot file. 更多...
bool empty () const
void enableFusion (bool fusion)
Enables or disables layer fusion in the network. 更多...
Mat forward (const 字符串 &outputName= 字符串 ())
Runs forward pass to compute output of layer with name outputName . 更多...
void forward ( OutputArrayOfArrays outputBlobs, const 字符串 &outputName= 字符串 ())
Runs forward pass to compute output of layer with name outputName . 更多...
void forward ( OutputArrayOfArrays outputBlobs, const std::vector< 字符串 > &outBlobNames)
Runs forward pass to compute outputs of layers listed in outBlobNames . 更多...
void forward (std::vector< std::vector< Mat > > &outputBlobs, const std::vector< 字符串 > &outBlobNames)
Runs forward pass to compute outputs of layers listed in outBlobNames . 更多...
AsyncArray forwardAsync (const 字符串 &outputName= 字符串 ())
Runs forward pass to compute output of layer with name outputName . 更多...
int64 getFLOPS (const std::vector< MatShape > &netInputShapes) const
Computes FLOP for whole loaded model with specified input shapes. 更多...
int64 getFLOPS (const MatShape &netInputShape) const
int64 getFLOPS (const int layerId, const std::vector< MatShape > &netInputShapes) const
int64 getFLOPS (const int layerId, const MatShape &netInputShape) const
Ptr < > getLayer ( LayerId layerId)
Returns pointer to layer with specified id or name which the network use. 更多...
int getLayerId (const 字符串 &layer)
Converts string name of the layer to the integer identifier. 更多...
std::vector< Ptr < > > getLayerInputs ( LayerId layerId)
Returns pointers to input layers of specific layer. 更多...
std::vector< 字符串 > getLayerNames () const
int getLayersCount (const 字符串 &layerType) const
Returns count of layers of specified type. 更多...
void getLayerShapes (const MatShape &netInputShape, const int layerId, std::vector< MatShape > &inLayerShapes, std::vector< MatShape > &outLayerShapes) const
Returns input and output shapes for layer with specified id in loaded model; preliminary inferencing isn't necessary. 更多...
void getLayerShapes (const std::vector< MatShape > &netInputShapes, const int layerId, std::vector< MatShape > &inLayerShapes, std::vector< MatShape > &outLayerShapes) const
void getLayersShapes (const std::vector< MatShape > &netInputShapes, std::vector< int > &layersIds, std::vector< std::vector< MatShape > > &inLayersShapes, std::vector< std::vector< MatShape > > &outLayersShapes) const
Returns input and output shapes for all layers in loaded model; preliminary inferencing isn't necessary. 更多...
void getLayersShapes (const MatShape &netInputShape, std::vector< int > &layersIds, std::vector< std::vector< MatShape > > &inLayersShapes, std::vector< std::vector< MatShape > > &outLayersShapes) const
void getLayerTypes (std::vector< 字符串 > &layersTypes) const
Returns list of types for layer used in model. 更多...
void getMemoryConsumption (const std::vector< MatShape > &netInputShapes, size_t &weights, size_t &blobs) const
Computes bytes number which are required to store all weights and intermediate blobs for model. 更多...
void getMemoryConsumption (const MatShape &netInputShape, size_t &weights, size_t &blobs) const
void getMemoryConsumption (const int layerId, const std::vector< MatShape > &netInputShapes, size_t &weights, size_t &blobs) const
void getMemoryConsumption (const int layerId, const MatShape &netInputShape, size_t &weights, size_t &blobs) const
void getMemoryConsumption (const std::vector< MatShape > &netInputShapes, std::vector< int > &layerIds, std::vector< size_t > &weights, std::vector< size_t > &blobs) const
Computes bytes number which are required to store all weights and intermediate blobs for each layer. 更多...
void getMemoryConsumption (const MatShape &netInputShape, std::vector< int > &layerIds, std::vector< size_t > &weights, std::vector< size_t > &blobs) const
Mat getParam ( LayerId layer, int numParam=0)
Returns parameter blob of the layer. 更多...
int64 getPerfProfile (std::vector< double > &timings)
Returns overall time for inference and timings (in ticks) for layers. Indexes in returned vector correspond to layers ids. Some layers can be fused with others, in this case zero ticks count will be return for that skipped layers. 更多...
std::vector< int > getUnconnectedOutLayers () const
Returns indexes of layers with unconnected outputs. 更多...
std::vector< 字符串 > getUnconnectedOutLayersNames () const
Returns names of layers with unconnected outputs. 更多...
void setHalideScheduler (const 字符串 &scheduler)
Compile Halide layers. 更多...
void setInput ( InputArray blob, const 字符串 &name="", double scalefactor=1.0, const Scalar & mean = Scalar ())
Sets the new input value for the network. 更多...
void setInputsNames (const std::vector< 字符串 > &inputBlobNames)
Sets outputs names of the network input pseudo layer. 更多...
void setParam ( LayerId layer, int numParam, const Mat &blob)
Sets the new value for the learned param of the layer. 更多...
void setPreferableBackend (int backendId)
Ask network to use specific computation backend where it supported. 更多...
void setPreferableTarget (int targetId)
Ask network to make computations on specific target device. 更多...

额外继承成员

- Public Types inherited from cv::dnn::Net
typedef DictValue LayerId
Container for strings and integers. 更多...
- Static Public Member Functions inherited from cv::dnn::Net
static Net readFromModelOptimizer (const 字符串 &xml, const 字符串 &bin)
Create a network from Intel's Model Optimizer intermediate representation (IR). 更多...
static 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). 更多...
- Protected Attributes inherited from cv::dnn::Model
Ptr < Impl > impl

详细描述

This class represents high-level API for keypoints models.

KeypointsModel allows to set params for preprocessing input image. KeypointsModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and returns the x and y coordinates of each detected keypoint

Constructor & Destructor Documentation

KeypointsModel() [1/2]

cv::dnn::KeypointsModel::KeypointsModel ( const 字符串 & model ,
const 字符串 & config = ""
)
Python:
<dnn_KeypointsModel object> = cv.dnn_KeypointsModel( model[, config] )
<dnn_KeypointsModel object> = cv.dnn_KeypointsModel( network )

Create keypoints model from network represented in one of the supported formats. An order of model and config arguments does not matter.

参数
[in] model Binary file contains trained weights.
[in] config Text file contains network configuration.

KeypointsModel() [2/2]

cv::dnn::KeypointsModel::KeypointsModel ( const Net & network )
Python:
<dnn_KeypointsModel object> = cv.dnn_KeypointsModel( model[, config] )
<dnn_KeypointsModel object> = cv.dnn_KeypointsModel( network )

Create model from deep learning network.

参数
[in] network Net 对象。

成员函数文档编制

estimate()

std::vector< Point2f > cv::dnn::KeypointsModel::estimate ( InputArray frame ,
float thresh = 0.5
)
Python:
retval = cv.dnn_KeypointsModel.estimate( frame[, thresh] )

Given the input frame, create input blob, run net.

参数
[in] frame The input image.
thresh minimum confidence threshold to select a keypoint
返回
a vector holding the x and y coordinates of each detected keypoint

The documentation for this class was generated from the following file: