DNNベースの顔検出器。 続き...
#include <opencv2/objdetect/face.hpp>
|
| static Ptr< FaceDetectorYN > | create (const String &framework, const std::vector< uchar > &bufferModel, const std::vector< uchar > &bufferConfig, const Size &input_size, float score_threshold=0.9f, float nms_threshold=0.3f, int top_k=5000, int backend_id=0, int target_id=0) |
| |
| static Ptr< FaceDetectorYN > | create (CV_WRAP_FILE_PATH const String &model, CV_WRAP_FILE_PATH const String &config, const Size &input_size, float score_threshold=0.9f, float nms_threshold=0.3f, int top_k=5000, int backend_id=0, int target_id=0) |
| | 指定した引数で顔検出器クラスのインスタンスを生成する。
|
| |
◆ ~FaceDetectorYN()
| virtual cv::FaceDetectorYN::~FaceDetectorYN |
( |
| ) |
|
|
inlinevirtual |
◆ create() [1/2]
| static Ptr< FaceDetectorYN > cv::FaceDetectorYN::create |
( |
const String & | framework, |
|
|
const std::vector< uchar > & | bufferModel, |
|
|
const std::vector< uchar > & | bufferConfig, |
|
|
const Size & | input_size, |
|
|
float | score_threshold = 0.9f, |
|
|
float | nms_threshold = 0.3f, |
|
|
int | top_k = 5000, |
|
|
int | backend_id = 0, |
|
|
int | target_id = 0 ) |
|
static |
| Python: |
|---|
| cv.FaceDetectorYN.create( | model, config, input_size[, score_threshold[, nms_threshold[, top_k[, backend_id[, target_id]]]]] | ) -> | retval |
| cv.FaceDetectorYN.create( | framework, bufferModel, bufferConfig, input_size[, score_threshold[, nms_threshold[, top_k[, backend_id[, target_id]]]]] | ) -> | retval |
| cv.FaceDetectorYN_create( | model, config, input_size[, score_threshold[, nms_threshold[, top_k[, backend_id[, target_id]]]]] | ) -> | retval |
| cv.FaceDetectorYN_create( | framework, bufferModel, bufferConfig, input_size[, score_threshold[, nms_threshold[, top_k[, backend_id[, target_id]]]]] | ) -> | retval |
これは利便性のために提供されているオーバーロードされたメンバ関数である。上記の関数とは、受け取る引数のみが異なる。
- 引数
-
| framework | 元のフレームワークの名前 |
| bufferModel | 重みを格納したバイナリファイルの内容を持つバッファ |
| bufferConfig | ネットワーク構成を記述したテキストファイルの内容を持つバッファ |
| input_size | 入力画像のサイズ |
| score_threshold | 指定した値より小さいスコアのバウンディングボックスを除外するためのしきい値 |
| nms_threshold | 指定した値より大きいIoUのバウンディングボックスを抑制するためのしきい値 |
| top_k | NMSの前に保持する上位K個のバウンディングボックス |
| backend_id | バックエンドのID |
| target_id | ターゲットデバイスのID |
◆ create() [2/2]
| Python: |
|---|
| cv.FaceDetectorYN.create( | model, config, input_size[, score_threshold[, nms_threshold[, top_k[, backend_id[, target_id]]]]] | ) -> | retval |
| cv.FaceDetectorYN.create( | framework, bufferModel, bufferConfig, input_size[, score_threshold[, nms_threshold[, top_k[, backend_id[, target_id]]]]] | ) -> | retval |
| cv.FaceDetectorYN_create( | model, config, input_size[, score_threshold[, nms_threshold[, top_k[, backend_id[, target_id]]]]] | ) -> | retval |
| cv.FaceDetectorYN_create( | framework, bufferModel, bufferConfig, input_size[, score_threshold[, nms_threshold[, top_k[, backend_id[, target_id]]]]] | ) -> | retval |
指定した引数で顔検出器クラスのインスタンスを生成する。
- 引数
-
| model | 要求するモデルへのパス |
| config | 互換性のための設定ファイルのパス。ONNXモデルでは不要である |
| input_size | 入力画像のサイズ |
| score_threshold | 指定した値より小さいスコアのバウンディングボックスを除外するためのしきい値 |
| nms_threshold | 指定した値より大きいIoUのバウンディングボックスを抑制するためのしきい値 |
| top_k | NMSの前に保持する上位K個のバウンディングボックス |
| backend_id | バックエンドのID |
| target_id | ターゲットデバイスのID |
◆ detect()
| Python: |
|---|
| cv.FaceDetectorYN.detect( | image[, faces] | ) -> | retval, faces |
入力画像から顔を検出する。以下は出力例である。
image
- 引数
-
| image | 検出対象の画像 |
| faces | 形状が [num_faces, 15] の2次元 cv::Mat に格納された検出結果 - 0-1: バウンディングボックスの左上隅の x, y
- 2-3: バウンディングボックスの幅と高さ
- 4-5: 右目の x, y(サンプル画像の青い点)
- 6-7: 左目の x, y(サンプル画像の赤い点)
- 8-9: 鼻先の x, y(サンプル画像の緑の点)
- 10-11: 口の右端の x, y(サンプル画像のピンクの点)
- 12-13: 口の左端の x, y(サンプル画像の黄色い点)
- 14: 顔のスコア
|
◆ getInputSize()
| virtual Size cv::FaceDetectorYN::getInputSize |
( |
| ) |
|
|
pure virtual |
| Python: |
|---|
| cv.FaceDetectorYN.getInputSize( | | ) -> | retval |
◆ getNMSThreshold()
| virtual float cv::FaceDetectorYN::getNMSThreshold |
( |
| ) |
|
|
pure virtual |
| Python: |
|---|
| cv.FaceDetectorYN.getNMSThreshold( | | ) -> | retval |
◆ getScoreThreshold()
| virtual float cv::FaceDetectorYN::getScoreThreshold |
( |
| ) |
|
|
pure virtual |
| Python: |
|---|
| cv.FaceDetectorYN.getScoreThreshold( | | ) -> | retval |
◆ getTopK()
| virtual int cv::FaceDetectorYN::getTopK |
( |
| ) |
|
|
pure virtual |
| Python: |
|---|
| cv.FaceDetectorYN.getTopK( | | ) -> | retval |
◆ setInputSize()
| virtual void cv::FaceDetectorYN::setInputSize |
( |
const Size & | input_size | ) |
|
|
pure virtual |
| Python: |
|---|
| cv.FaceDetectorYN.setInputSize( | input_size | ) -> | None |
ネットワークの入力サイズを設定する。これはモデル作成時の入力サイズを上書きする。入力画像のサイズがモデル作成時の入力サイズと一致しない場合にこのメソッドを呼び出す。
- 引数
-
◆ setNMSThreshold()
| virtual void cv::FaceDetectorYN::setNMSThreshold |
( |
float | nms_threshold | ) |
|
|
pure virtual |
| Python: |
|---|
| cv.FaceDetectorYN.setNMSThreshold( | nms_threshold | ) -> | None |
Non-maximum-suppressionのしきい値を設定し、与えた値より大きいIoUを持つバウンディングボックスを抑制する。
- 引数
-
◆ setScoreThreshold()
| virtual void cv::FaceDetectorYN::setScoreThreshold |
( |
float | score_threshold | ) |
|
|
pure virtual |
| Python: |
|---|
| cv.FaceDetectorYN.setScoreThreshold( | score_threshold | ) -> | None |
スコアのしきい値を設定し、与えた値未満のスコアを持つバウンディングボックスを除外する。
- 引数
-
| score_threshold | バウンディングボックスを除外するためのしきい値 |
◆ setTopK()
| virtual void cv::FaceDetectorYN::setTopK |
( |
int | top_k | ) |
|
|
pure virtual |
| Python: |
|---|
| cv.FaceDetectorYN.setTopK( | top_k | ) -> | None |
NMSの前に保持するバウンディングボックスの数を設定する。
- 引数
-
| top_k | スコアに基づく上位ランクから保持するバウンディングボックスの数 |
このクラス詳解は次のファイルから抽出されました: