This class is presented high-level API for neural networks.
[詳解]
#include <dnn.hpp>
cv::dnn::ClassificationModel, cv::dnn::DetectionModel, cv::dnn::KeypointsModel, cv::dnn::SegmentationModel, cv::dnn::TextDetectionModel, cv::dnn::TextRecognitionModelに継承されています。
This class is presented high-level API for neural networks.
Model allows to set params for preprocessing input image. Model creates net from file with trained weights and config, sets preprocessing input and runs forward pass.
◆ Model() [1/2]
CV_WRAP cv::dnn::Model::Model |
( |
const String & |
model, |
|
|
const String & |
config = "" |
|
) |
| |
Create model from deep learning 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. |
◆ Model() [2/2]
CV_WRAP cv::dnn::Model::Model |
( |
const Net & |
network | ) |
|
Create model from deep learning network.
- 引数
-
◆ predict()
Given the input
frame, create input blob, run net and return the output blobs
.
- 引数
-
[in] | frame | The input image. |
[out] | outs | Allocated output blobs, which will store results of the computation. |
◆ setInputCrop()
CV_WRAP Model & cv::dnn::Model::setInputCrop |
( |
bool |
crop | ) |
|
Set flag crop for frame.
- 引数
-
[in] | crop | Flag which indicates whether image will be cropped after resize or not. |
◆ setInputMean()
CV_WRAP Model & cv::dnn::Model::setInputMean |
( |
const Scalar & |
mean | ) |
|
Set mean value for frame.
- 引数
-
[in] | mean | Scalar with mean values which are subtracted from channels. |
◆ setInputParams()
CV_WRAP void cv::dnn::Model::setInputParams |
( |
double |
scale = 1.0 , |
|
|
const Size & |
size = Size() , |
|
|
const Scalar & |
mean = Scalar() , |
|
|
bool |
swapRB = false , |
|
|
bool |
crop = false |
|
) |
| |
Set preprocessing parameters for frame.
- 引数
-
[in] | size | New input size. |
[in] | mean | Scalar with mean values which are subtracted from channels. |
[in] | scale | Multiplier for frame values. |
[in] | swapRB | Flag which indicates that swap first and last channels. |
[in] | crop | Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) ) |
◆ setInputScale()
CV_WRAP Model & cv::dnn::Model::setInputScale |
( |
double |
scale | ) |
|
Set scalefactor value for frame.
- 引数
-
[in] | scale | Multiplier for frame values. |
◆ setInputSize() [1/2]
CV_WRAP Model & cv::dnn::Model::setInputSize |
( |
const Size & |
size | ) |
|
Set input size for frame.
- 引数
-
- 覚え書き
- If shape of the new blob less than 0, then frame size not change.
◆ setInputSize() [2/2]
CV_WRAP Model & cv::dnn::Model::setInputSize |
( |
int |
width, |
|
|
int |
height |
|
) |
| |
|
inline |
これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。
- 引数
-
[in] | width | New input width. |
[in] | height | New input height. |
◆ setInputSwapRB()
CV_WRAP Model & cv::dnn::Model::setInputSwapRB |
( |
bool |
swapRB | ) |
|
Set flag swapRB for frame.
- 引数
-
[in] | swapRB | Flag which indicates that swap first and last channels. |
◆ setPreferableBackend()
◆ setPreferableTarget()
このクラス詳解は次のファイルから抽出されました: