mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
@@ -44,6 +44,9 @@
|
||||
|
||||
#include <vector>
|
||||
#include <opencv2/core.hpp>
|
||||
#ifdef CV_CXX11
|
||||
#include <future>
|
||||
#endif
|
||||
|
||||
#include "../dnn/version.hpp"
|
||||
|
||||
@@ -57,6 +60,18 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
|
||||
typedef std::vector<int> MatShape;
|
||||
|
||||
#if defined(CV_CXX11) || defined(CV_DOXYGEN)
|
||||
typedef std::future<Mat> AsyncMat;
|
||||
#else
|
||||
// Just a workaround for bindings.
|
||||
struct AsyncMat
|
||||
{
|
||||
Mat get() { return Mat(); }
|
||||
void wait() const {}
|
||||
size_t wait_for(size_t milliseconds) const { CV_UNUSED(milliseconds); return -1; }
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enum of computation backends supported by layers.
|
||||
* @see Net::setPreferableBackend
|
||||
@@ -68,7 +83,7 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
//! DNN_BACKEND_OPENCV otherwise.
|
||||
DNN_BACKEND_DEFAULT,
|
||||
DNN_BACKEND_HALIDE,
|
||||
DNN_BACKEND_INFERENCE_ENGINE,
|
||||
DNN_BACKEND_INFERENCE_ENGINE, //!< Intel's Inference Engine computational backend.
|
||||
DNN_BACKEND_OPENCV,
|
||||
DNN_BACKEND_VKCOM
|
||||
};
|
||||
@@ -84,8 +99,7 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
DNN_TARGET_OPENCL_FP16,
|
||||
DNN_TARGET_MYRIAD,
|
||||
DNN_TARGET_VULKAN,
|
||||
//! FPGA device with CPU fallbacks using Inference Engine's Heterogeneous plugin.
|
||||
DNN_TARGET_FPGA
|
||||
DNN_TARGET_FPGA //!< FPGA device with CPU fallbacks using Inference Engine's Heterogeneous plugin.
|
||||
};
|
||||
|
||||
CV_EXPORTS std::vector< std::pair<Backend, Target> > getAvailableBackends();
|
||||
@@ -458,6 +472,15 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
*/
|
||||
CV_WRAP Mat forward(const String& outputName = String());
|
||||
|
||||
/** @brief Runs forward pass to compute output of layer with name @p outputName.
|
||||
* @param outputName name for layer which output is needed to get
|
||||
* @details By default runs forward pass for the whole network.
|
||||
*
|
||||
* This is an asynchronous version of forward(const String&).
|
||||
* dnn::DNN_BACKEND_INFERENCE_ENGINE backend is required.
|
||||
*/
|
||||
CV_WRAP AsyncMat forwardAsync(const String& outputName = String());
|
||||
|
||||
/** @brief Runs forward pass to compute output of layer with name @p outputName.
|
||||
* @param outputBlobs contains all output blobs for specified layer.
|
||||
* @param outputName name for layer which output is needed to get
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define OPENCV_DNN_VERSION_HPP
|
||||
|
||||
/// Use with major OpenCV version only.
|
||||
#define OPENCV_DNN_API_VERSION 20190412
|
||||
#define OPENCV_DNN_API_VERSION 20190422
|
||||
|
||||
#if !defined CV_DOXYGEN && !defined CV_STATIC_ANALYSIS && !defined CV_DNN_DONT_ADD_INLINE_NS
|
||||
#define CV__DNN_INLINE_NS __CV_CAT(dnn4_v, OPENCV_DNN_API_VERSION)
|
||||
|
||||
Reference in New Issue
Block a user