Skip to content

Commit 348414d

Browse files
committed
Merge pull request opencv#17873 from dmatveev:dm/fix_vs_infer2
2 parents 1fabe92 + 243ce78 commit 348414d

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

modules/gapi/include/opencv2/gapi/infer.hpp

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,6 @@ class GNetworkType<K, std::function<std::tuple<R...>(Args...)> >
7777

7878
using ResultL = std::tuple< cv::GArray<R>... >;
7979
using APIList = std::function<ResultL(cv::GArray<cv::Rect>, Args...)>;
80-
81-
// APIList2 is also template to allow different calling options
82-
// (GArray<cv::Rect> vs GArray<cv::GMat> per input)
83-
template<class... Ts>
84-
using APIList2 = typename std::enable_if
85-
< cv::detail::valid_infer2_types< std::tuple<Args...>
86-
, std::tuple<Ts...> >::value,
87-
std::function<ResultL(cv::GMat, cv::GArray<Ts>...)>
88-
>::type;
8980
};
9081

9182
// Single-return-value network definition (specialized base class)
@@ -101,14 +92,16 @@ class GNetworkType<K, std::function<R(Args...)> >
10192

10293
using ResultL = cv::GArray<R>;
10394
using APIList = std::function<ResultL(cv::GArray<cv::Rect>, Args...)>;
95+
};
10496

105-
// APIList2 is also template to allow different calling options
106-
// (GArray<cv::Rect> vs GArray<cv::GMat> per input)
107-
template<class... Ts>
108-
using APIList2 = typename std::enable_if
109-
< cv::detail::valid_infer2_types< std::tuple<Args...>
97+
// APIList2 is also template to allow different calling options
98+
// (GArray<cv::Rect> vs GArray<cv::GMat> per input)
99+
template<class Net, class... Ts>
100+
struct InferAPIList2 {
101+
using type = typename std::enable_if
102+
< cv::detail::valid_infer2_types< typename Net::InArgs
110103
, std::tuple<Ts...> >::value,
111-
std::function<ResultL(cv::GMat, cv::GArray<Ts>...)>
104+
std::function<typename Net::ResultL(cv::GMat, cv::GArray<Ts>...)>
112105
>::type;
113106
};
114107

@@ -185,7 +178,7 @@ template<typename Net, typename... Args>
185178
struct GInferList2 final
186179
: public GInferList2Base
187180
, public detail::KernelTypeMedium< GInferList2<Net, Args...>
188-
, typename Net::template APIList2<Args...> > {
181+
, typename InferAPIList2<Net, Args...>::type > {
189182
using GInferList2Base::getOutMeta; // FIXME: name lookup conflict workaround?
190183

191184
static constexpr const char* tag() { return Net::tag(); }

0 commit comments

Comments
 (0)