此类代表用于目标检测网络的高级 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 的新值 |
此类文档由以下文件生成