このクラスは分類モデル向けの高レベルAPIを表す。詳細...
#include <opencv2/dnn/dnn.hpp>
|
| | ClassificationModel () |
| |
| | ClassificationModel (const Net &network) |
| | ディープラーニングのネットワークからモデルを作成する。
|
| |
| | ClassificationModel (CV_WRAP_FILE_PATH const String &model, CV_WRAP_FILE_PATH const String &config="") |
| | サポートされている形式のいずれかで表現されたネットワークから分類モデルを作成する。model と config 引数の順序は問わない。
|
| |
| std::pair< int, float > | classify (InputArray frame) |
| | input フレームを与え、入力blobを作成し、netを実行してトップ1の予測を返す。
|
| |
| void | classify (InputArray frame, int &classId, float &conf) |
| |
| bool | getEnableSoftmaxPostProcessing () const |
| | softmax後処理オプションの有効/無効を取得する。
|
| |
| ClassificationModel & | setEnableSoftmaxPostProcessing (bool enable) |
| | softmax後処理オプションの有効/無効を設定する。
|
| |
| | Model () |
| |
| | Model (const Model &)=default |
| |
| | Model (const Net &network) |
| | ディープラーニングのネットワークからモデルを作成する。
|
| |
| | Model (CV_WRAP_FILE_PATH const String &model, CV_WRAP_FILE_PATH const String &config="") |
| | サポートされている形式のいずれかで表現されたディープラーニングのネットワークからモデルを作成する。model と config 引数の順序は問わない。
|
| |
| | Model (Model &&)=default |
| |
| Model & | enableWinograd (bool useWinograd) |
| |
| Impl * | getImpl () const |
| |
| Impl & | getImplRef () const |
| |
| Net & | getNetwork_ () |
| |
| Net & | getNetwork_ () const |
| |
| | operator Net & () const |
| |
| Model & | operator= (const Model &)=default |
| |
| Model & | operator= (Model &&)=default |
| |
| void | predict (InputArray frame, OutputArrayOfArrays outs) const |
| | input フレームを与え、入力blobを作成し、netを実行して出力 blobs を返す。
|
| |
| Model & | setInputCrop (bool crop) |
| | フレームに対するcropフラグを設定する。
|
| |
| Model & | setInputMean (const Scalar &mean) |
| | フレームに対する平均値を設定する。
|
| |
| void | setInputParams (double scale=1.0, const Size &size=Size(), const Scalar &mean=Scalar(), bool swapRB=false, bool crop=false) |
| | フレームの前処理パラメータを設定する。
|
| |
| Model & | setInputScale (const Scalar &scale) |
| | フレームのscalefactor値を設定する。
|
| |
| Model & | setInputSize (const Size &size) |
| | フレームの入力サイズを設定する。
|
| |
| Model & | setInputSize (int width, int height) |
| |
| Model & | setInputSwapRB (bool swapRB) |
| | フレームのフラグswapRBを設定する。
|
| |
| Model & | setOutputNames (const std::vector< String > &outNames) |
| | フレームの出力名を設定する。
|
| |
| Model & | setPreferableBackend (dnn::Backend backendId) |
| |
| Model & | setPreferableTarget (dnn::Target targetId) |
| |
このクラスは分類モデル向けの高レベルAPIを表す。
ClassificationModel は入力画像の前処理に関する引数を設定できる。ClassificationModel は学習済み重みと設定ファイルからネットワークを生成し、入力の前処理を設定し、順伝播を実行してtop-1の予測を返す。
◆ ClassificationModel() [1/3]
| cv::dnn::ClassificationModel::ClassificationModel |
( |
| ) |
|
| Python: |
|---|
| cv.dnn.ClassificationModel( | model[, config] | ) -> | <dnn_ClassificationModel object> |
| cv.dnn.ClassificationModel( | network | ) -> | <dnn_ClassificationModel object> |
◆ ClassificationModel() [2/3]
| Python: |
|---|
| cv.dnn.ClassificationModel( | model[, config] | ) -> | <dnn_ClassificationModel object> |
| cv.dnn.ClassificationModel( | network | ) -> | <dnn_ClassificationModel object> |
サポートされている形式のいずれかで表現されたネットワークから分類モデルを生成する。model と config 引数の順序は問わない。
- 引数
-
| [in] | model | 学習済みの重みを格納したバイナリファイル。 |
| [in] | config | ネットワーク構成を記述したテキストファイル。 |
◆ ClassificationModel() [3/3]
| cv::dnn::ClassificationModel::ClassificationModel |
( |
const Net & | network | ) |
|
| Python: |
|---|
| cv.dnn.ClassificationModel( | model[, config] | ) -> | <dnn_ClassificationModel object> |
| cv.dnn.ClassificationModel( | network | ) -> | <dnn_ClassificationModel object> |
ディープラーニングのネットワークからモデルを生成する。
- 引数
-
◆ classify() [1/2]
| std::pair< int, float > cv::dnn::ClassificationModel::classify |
( |
InputArray | frame | ) |
|
| Python: |
|---|
| cv.dnn.ClassificationModel.classify( | frame | ) -> | classId, conf |
与えられた input フレームから入力blobを生成し、ネットワークを実行してtop-1の予測を返す。
- 引数
-
◆ classify() [2/2]
| void cv::dnn::ClassificationModel::classify |
( |
InputArray | frame, |
|
|
int & | classId, |
|
|
float & | conf ) |
| Python: |
|---|
| cv.dnn.ClassificationModel.classify( | frame | ) -> | classId, conf |
これは利便性のために提供されているオーバーロードされたメンバ関数である。上記の関数とは、受け取る引数のみが異なる。
◆ getEnableSoftmaxPostProcessing()
| bool cv::dnn::ClassificationModel::getEnableSoftmaxPostProcessing |
( |
| ) |
const |
| Python: |
|---|
| cv.dnn.ClassificationModel.getEnableSoftmaxPostProcessing( | | ) -> | retval |
softmaxの後処理を有効化/無効化するオプションを取得する。
このオプションはデフォルトでfalseであり、classify() 関数内でsoftmaxの後処理は適用されない。
◆ setEnableSoftmaxPostProcessing()
| ClassificationModel & cv::dnn::ClassificationModel::setEnableSoftmaxPostProcessing |
( |
bool | enable | ) |
|
| Python: |
|---|
| cv.dnn.ClassificationModel.setEnableSoftmaxPostProcessing( | enable | ) -> | retval |
softmaxの後処理を有効化/無効化するオプションを設定する。
このオプションがtrueの場合、classify() 関数内で順伝播の後にsoftmaxが適用され、確信度の範囲を [0.0-1.0] に変換する。この関数を使うとこの動作を切り替えられる。モデルにsoftmax層が含まれていない場合はtrueにすること。
- 引数
-
このクラス詳解は次のファイルから抽出されました: