mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Merge branch 4.x
This commit is contained in:
@@ -291,7 +291,7 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
static Ptr<BaseConvolutionLayer> create(const LayerParams& params);
|
||||
bool fusedActivation = false;
|
||||
bool fusedAdd = false;
|
||||
bool useWinograd = false; // Flag whether to use Winograd to speed up 3x3 convolution.
|
||||
bool useWinograd = true; // Flag whether to use Winograd to speed up 3x3 convolution.
|
||||
};
|
||||
|
||||
class CV_EXPORTS ConvolutionLayerInt8 : public BaseConvolutionLayer
|
||||
@@ -303,7 +303,7 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
// quantization type flag. The perChannel default is true, that means it contains the parameters
|
||||
// of per-Channel quantization. Otherwise, that means this layer contains per-Tensor quantized parameters.
|
||||
bool per_channel;
|
||||
bool useWinograd = true; // Flag whether to use Winograd to speed up 3x3 convolution.
|
||||
bool useWinograd = false; // Flag whether to use Winograd to speed up 3x3 convolution.
|
||||
static Ptr<BaseConvolutionLayer> create(const LayerParams& params);
|
||||
};
|
||||
|
||||
@@ -1160,12 +1160,29 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
static Ptr<GemmLayer> create(const LayerParams& params);
|
||||
};
|
||||
|
||||
class CV_EXPORTS MatMulLayer : public Layer {
|
||||
public:
|
||||
static Ptr<MatMulLayer> create(const LayerParams ¶ms);
|
||||
};
|
||||
|
||||
class CV_EXPORTS ExpandLayer : public Layer
|
||||
{
|
||||
public:
|
||||
static Ptr<ExpandLayer> create(const LayerParams ¶ms);
|
||||
};
|
||||
|
||||
class CV_EXPORTS InstanceNormLayer : public Layer {
|
||||
public:
|
||||
float epsilon;
|
||||
|
||||
static Ptr<InstanceNormLayer> create(const LayerParams ¶ms);
|
||||
};
|
||||
|
||||
class CV_EXPORTS AttentionLayer : public Layer {
|
||||
public:
|
||||
static Ptr<AttentionLayer> create(const LayerParams ¶ms);
|
||||
};
|
||||
|
||||
//! @}
|
||||
//! @}
|
||||
CV__DNN_INLINE_NS_END
|
||||
|
||||
@@ -1127,7 +1127,7 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
CV_WRAP Image2BlobParams();
|
||||
CV_WRAP Image2BlobParams(const Scalar& scalefactor, const Size& size = Size(), const Scalar& mean = Scalar(),
|
||||
bool swapRB = false, int ddepth = CV_32F, DataLayout datalayout = DNN_LAYOUT_NCHW,
|
||||
ImagePaddingMode mode = DNN_PMODE_NULL);
|
||||
ImagePaddingMode mode = DNN_PMODE_NULL, Scalar borderValue = 0.0);
|
||||
|
||||
CV_PROP_RW Scalar scalefactor; //!< scalefactor multiplier for input image values.
|
||||
CV_PROP_RW Size size; //!< Spatial size for output image.
|
||||
@@ -1136,6 +1136,21 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
CV_PROP_RW int ddepth; //!< Depth of output blob. Choose CV_32F or CV_8U.
|
||||
CV_PROP_RW DataLayout datalayout; //!< Order of output dimensions. Choose DNN_LAYOUT_NCHW or DNN_LAYOUT_NHWC.
|
||||
CV_PROP_RW ImagePaddingMode paddingmode; //!< Image padding mode. @see ImagePaddingMode.
|
||||
CV_PROP_RW Scalar borderValue; //!< Value used in padding mode for padding.
|
||||
|
||||
/** @brief Get rectangle coordinates in original image system from rectangle in blob coordinates.
|
||||
* @param rBlob rect in blob coordinates.
|
||||
* @param size original input image size.
|
||||
* @returns rectangle in original image coordinates.
|
||||
*/
|
||||
CV_WRAP Rect blobRectToImageRect(const Rect &rBlob, const Size &size);
|
||||
|
||||
/** @brief Get rectangle coordinates in original image system from rectangle in blob coordinates.
|
||||
* @param rBlob rect in blob coordinates.
|
||||
* @param rImg result rect in image coordinates.
|
||||
* @param size original input image size.
|
||||
*/
|
||||
CV_WRAP void blobRectsToImageRects(const std::vector<Rect> &rBlob, CV_OUT std::vector<Rect>& rImg, const Size& size);
|
||||
};
|
||||
|
||||
/** @brief Creates 4-dimensional blob from image with given params.
|
||||
@@ -1373,6 +1388,9 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
/// @sa Net::setPreferableTarget
|
||||
CV_WRAP Model& setPreferableTarget(dnn::Target targetId);
|
||||
|
||||
/// @sa Net::enableWinograd
|
||||
CV_WRAP Model& enableWinograd(bool useWinograd);
|
||||
|
||||
CV_DEPRECATED_EXTERNAL
|
||||
operator Net&() const { return getNetwork_(); }
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define OPENCV_DNN_VERSION_HPP
|
||||
|
||||
/// Use with major OpenCV version only.
|
||||
#define OPENCV_DNN_API_VERSION 20230620
|
||||
#define OPENCV_DNN_API_VERSION 20231225
|
||||
|
||||
#if !defined CV_DOXYGEN && !defined CV_STATIC_ANALYSIS && !defined CV_DNN_DONT_ADD_INLINE_NS
|
||||
#define CV__DNN_INLINE_NS __CV_CAT(dnn5_v, OPENCV_DNN_API_VERSION)
|
||||
|
||||
Reference in New Issue
Block a user