此類代表用於目標檢測網路的高階 API。 更多...
#include <opencv2/dnn/dnn.hpp>
|
| | DetectionModel () |
| |
| | DetectionModel (const Net &network) |
| | 從深度學習網路建立模型。
|
| |
| | DetectionModel (CV_WRAP_FILE_PATH const String &model, CV_WRAP_FILE_PATH const String &config="") |
| | 從支援的格式之一表示的網路建立檢測模型。 model 和 config 引數的順序無關緊要。
|
| |
| void | detect (InputArray frame, std::vector< int > &classIds, std::vector< float > &confidences, std::vector< Rect > &boxes, float confThreshold=0.5f, float nmsThreshold=0.0f) |
| | 給定 input 幀,建立輸入 blob,執行網路並返回結果檢測。
|
| |
| bool | getNmsAcrossClasses () |
| | nmsAcrossClasses 的 Getter。此變數預設為 false,這樣在 detect() 函式期間使用非最大值抑制時,它將僅按類執行。
|
| |
| DetectionModel & | setNmsAcrossClasses (bool value) |
| | nmsAcrossClasses 預設為 false,這樣在 detect() 函式期間使用非最大值抑制時,它將按類執行。此函式允許您切換此行為。
|
| |
| | 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,執行網路並返回輸出 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) |
| | 設定幀的縮放因子值。
|
| |
| 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。
DetectionModel 允許設定預處理輸入影像的引數。 DetectionModel 從帶有訓練權重的和配置的檔案建立網路,設定預處理輸入,執行前向傳遞並返回結果檢測。 對於 DetectionModel,支援 SSD、Faster R-CNN、YOLO 拓撲。
◆ DetectionModel() [1/3]
| Python |
|---|
| cv.dnn.DetectionModel( | model[, config] | ) -> | <dnn_DetectionModel 物件> |
| cv.dnn.DetectionModel( | network | ) -> | <dnn_DetectionModel 物件> |
從支援的格式之一表示的網路建立檢測模型。 model 和 config 引數的順序無關緊要。
- 引數
-
| [輸入] | model | 包含訓練權重的二進位制檔案。 |
| [輸入] | config | 包含網路配置的文字檔案。 |
◆ DetectionModel() [2/3]
| cv::dnn::DetectionModel::DetectionModel |
( |
const Net & | network | ) |
|
| Python |
|---|
| cv.dnn.DetectionModel( | model[, config] | ) -> | <dnn_DetectionModel 物件> |
| cv.dnn.DetectionModel( | network | ) -> | <dnn_DetectionModel 物件> |
◆ DetectionModel() [3/3]
| cv::dnn::DetectionModel::DetectionModel |
( |
| ) |
|
| Python |
|---|
| cv.dnn.DetectionModel( | model[, config] | ) -> | <dnn_DetectionModel 物件> |
| cv.dnn.DetectionModel( | network | ) -> | <dnn_DetectionModel 物件> |
◆ detect()
| void cv::dnn::DetectionModel::detect |
( |
InputArray | frame, |
|
|
std::vector< int > & | classIds, |
|
|
std::vector< float > & | confidences, |
|
|
std::vector< Rect > & | boxes, |
|
|
float | confThreshold = 0.5f, |
|
|
float | nmsThreshold = 0.0f ) |
| Python |
|---|
| cv.dnn.DetectionModel.detect( | frame[, confThreshold[, nmsThreshold]] | ) -> | classIds, confidences, boxes |
給定 input 幀,建立輸入 blob,執行網路並返回結果檢測。
- 引數
-
| [輸入] | frame | 輸入影像。 |
| [輸出] | classIds | 結果檢測中的類索引。 |
| [輸出] | confidences | 一組相應的置信度。 |
| [輸出] | boxes | 一組邊界框。 |
| [輸入] | confThreshold | 用於按置信度過濾框的閾值。 |
| [輸入] | nmsThreshold | 非最大值抑制中使用的閾值。 |
◆ getNmsAcrossClasses()
| bool cv::dnn::DetectionModel::getNmsAcrossClasses |
( |
| ) |
|
| Python |
|---|
| cv.dnn.DetectionModel.getNmsAcrossClasses( | | ) -> | retval |
nmsAcrossClasses 的 Getter。此變數預設為 false,這樣在 detect() 函式期間使用非最大值抑制時,它將僅按類執行。
◆ setNmsAcrossClasses()
| DetectionModel & cv::dnn::DetectionModel::setNmsAcrossClasses |
( |
bool | 值 | ) |
|
| Python |
|---|
| cv.dnn.DetectionModel.setNmsAcrossClasses( | 值 | ) -> | retval |
nmsAcrossClasses 預設為 false,這樣在 detect() 函式期間使用非最大值抑制時,它將按類執行。此函式允許您切換此行為。
- 引數
-
| [輸入] | 值 | nmsAcrossClasses 的新值 |
此類文件由以下檔案生成