diff options
Diffstat (limited to 'recipes-support')
-rw-r--r-- | recipes-support/opencv/opencv/fix-build-with-protobuf-v22.patch | 408 | ||||
-rw-r--r-- | recipes-support/opencv/opencv_4.6.0.imx.bb | 4 |
2 files changed, 411 insertions, 1 deletions
diff --git a/recipes-support/opencv/opencv/fix-build-with-protobuf-v22.patch b/recipes-support/opencv/opencv/fix-build-with-protobuf-v22.patch new file mode 100644 index 00000000..3538f24b --- /dev/null +++ b/recipes-support/opencv/opencv/fix-build-with-protobuf-v22.patch | |||
@@ -0,0 +1,408 @@ | |||
1 | From 5e4150826fea6f37276f348c65d94ce4847d1211 Mon Sep 17 00:00:00 2001 | ||
2 | From: Kumataro <Kumataro@users.noreply.github.com> | ||
3 | Date: Sat, 7 Oct 2023 10:11:25 +0900 | ||
4 | Subject: [PATCH] 3rdparty: supporting protobuf v22 and later | ||
5 | |||
6 | Upstream-Status: Submitted [https://github.com/opencv/opencv/pull/24372] | ||
7 | --- | ||
8 | cmake/OpenCVFindProtobuf.cmake | 37 ++++++++++++++++++++++++++++++++++ | ||
9 | modules/dnn/CMakeLists.txt | 9 +++++++++ | ||
10 | 2 files changed, 46 insertions(+) | ||
11 | |||
12 | diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake | ||
13 | index 8835347d1d..9bd5c28db8 100644 | ||
14 | --- a/cmake/OpenCVFindProtobuf.cmake | ||
15 | +++ b/cmake/OpenCVFindProtobuf.cmake | ||
16 | @@ -67,6 +67,38 @@ else() | ||
17 | endif() | ||
18 | endif() | ||
19 | |||
20 | +# See https://github.com/opencv/opencv/issues/24369 | ||
21 | +# In Protocol Buffers v22.0 and later drops C++11 support and depends abseil-cpp. | ||
22 | +# Details: https://protobuf.dev/news/2022-08-03/ | ||
23 | +# And if std::text_view is in abseil-cpp requests C++17 and later. | ||
24 | +if(HAVE_PROTOBUF) | ||
25 | + if("${Protobuf_VERSION}" MATCHES [[[0-9]+.([0-9]+).[0-9]+]]) | ||
26 | + string(COMPARE GREATER_EQUAL "${CMAKE_MATCH_1}" "22" REQUEST_ABSL) | ||
27 | + | ||
28 | + if(REQUEST_ABSL) | ||
29 | + string(COMPARE GREATER_EQUAL "${CMAKE_CXX_STANDARD}" "17" USED_AFTER_CXX17) | ||
30 | + if(NOT USED_AFTER_CXX17) | ||
31 | + message("CMAKE_CXX_STANDARD : ${CMAKE_CXX_STANDARD}") | ||
32 | + message("protobuf : ${Protobuf_VERSION}") | ||
33 | + message(FATAL_ERROR "protobuf(v22 and later) and abseil-cpp request CMAKE_CXX_STANDARD=17 and later.") | ||
34 | + endif() | ||
35 | + | ||
36 | + ocv_check_modules(ABSL_STRINGS absl_strings) | ||
37 | + if(NOT ABSL_STRINGS_FOUND) | ||
38 | + message(FATAL_ERROR "protobuf(v22 and later) requests abseil-cpp(strings), but missing.") | ||
39 | + endif() | ||
40 | + | ||
41 | + ocv_check_modules(ABSL_LOG absl_log) | ||
42 | + if(NOT ABSL_LOG_FOUND) | ||
43 | + message(FATAL_ERROR "protobuf(v22 and later) requests abseil-cpp(log), but missing.") | ||
44 | + endif() | ||
45 | + | ||
46 | + endif() | ||
47 | + else() | ||
48 | + message(FATAL_ERROR "Protobuf version(${Protobuf_VERSION}) is unexpected to split.") | ||
49 | + endif() | ||
50 | +endif() | ||
51 | + | ||
52 | if(HAVE_PROTOBUF AND PROTOBUF_UPDATE_FILES AND NOT COMMAND PROTOBUF_GENERATE_CPP) | ||
53 | message(FATAL_ERROR "Can't configure protobuf dependency (BUILD_PROTOBUF=${BUILD_PROTOBUF} PROTOBUF_UPDATE_FILES=${PROTOBUF_UPDATE_FILES})") | ||
54 | endif() | ||
55 | @@ -89,3 +121,8 @@ if(HAVE_PROTOBUF) | ||
56 | BUILD_PROTOBUF THEN "build (${Protobuf_VERSION})" | ||
57 | ELSE "${__location} (${Protobuf_VERSION})") | ||
58 | endif() | ||
59 | + | ||
60 | +if(HAVE_ABSL_STRINGS AND HAVE_ABSL_LOG) | ||
61 | + list(APPEND CUSTOM_STATUS absl) | ||
62 | + list(APPEND CUSTOM_STATUS_absl " abseil-cpp:" "YES (${ABSL_STRINGS_VERSION})" ) | ||
63 | +endif() | ||
64 | diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt | ||
65 | index 804b78ead2..d32007b37e 100644 | ||
66 | --- a/modules/dnn/CMakeLists.txt | ||
67 | +++ b/modules/dnn/CMakeLists.txt | ||
68 | @@ -149,6 +149,15 @@ if(NOT BUILD_PROTOBUF) | ||
69 | list(APPEND include_dirs ${Protobuf_INCLUDE_DIRS}) | ||
70 | endif() | ||
71 | |||
72 | +if(HAVE_ABSL_STRINGS) | ||
73 | + list(APPEND libs ${ABSL_STRINGS_LIBRARIES}) | ||
74 | + list(APPEND include_dirs ${ABSL_STRTRINGS_INCLUDE_DIRS}) | ||
75 | +endif() | ||
76 | +if(HAVE_ABSL_LOG) | ||
77 | + list(APPEND libs ${ABSL_LOG_LIBRARIES}) | ||
78 | + list(APPEND include_dirs ${ABSL_LOG_INCLUDE_DIRS}) | ||
79 | +endif() | ||
80 | + | ||
81 | set(sources_options "") | ||
82 | |||
83 | list(APPEND libs ${LAPACK_LIBRARIES}) | ||
84 | From 06a7669521d205f647d3e718322ccd153cdbbb77 Mon Sep 17 00:00:00 2001 | ||
85 | From: Kumataro <Kumataro@users.noreply.github.com> | ||
86 | Date: Sun, 8 Oct 2023 09:39:35 +0900 | ||
87 | Subject: [PATCH] dnn: disable some tests for external protobuf | ||
88 | |||
89 | --- | ||
90 | modules/dnn/CMakeLists.txt | 5 +++++ | ||
91 | modules/dnn/src/caffe/caffe_io.cpp | 24 ++++++++++++++++++++++-- | ||
92 | modules/dnn/test/test_layers.cpp | 16 ++++++++++++++++ | ||
93 | 3 files changed, 43 insertions(+), 2 deletions(-) | ||
94 | |||
95 | diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt | ||
96 | index d32007b37e..face38465f 100644 | ||
97 | --- a/modules/dnn/CMakeLists.txt | ||
98 | +++ b/modules/dnn/CMakeLists.txt | ||
99 | @@ -254,6 +254,12 @@ ocv_create_module(${libs} ${dnn_runtime_libs}) | ||
100 | ocv_add_samples() | ||
101 | ocv_add_accuracy_tests(${dnn_runtime_libs}) | ||
102 | |||
103 | +if(NOT BUILD_PROTOBUF) | ||
104 | + if(TARGET opencv_test_dnn) | ||
105 | + ocv_target_compile_definitions(opencv_test_dnn PRIVATE "OPENCV_DNN_EXTERNAL_PROTOBUF=1") | ||
106 | + endif() | ||
107 | +endif() | ||
108 | + | ||
109 | set(perf_path "${CMAKE_CURRENT_LIST_DIR}/perf") | ||
110 | file(GLOB_RECURSE perf_srcs "${perf_path}/*.cpp") | ||
111 | file(GLOB_RECURSE perf_hdrs "${perf_path}/*.hpp" "${perf_path}/*.h") | ||
112 | |||
113 | diff --git a/modules/dnn/src/caffe/caffe_io.cpp b/modules/dnn/src/caffe/caffe_io.cpp | ||
114 | index ebecf95eea..ebceca84cf 100644 | ||
115 | --- a/modules/dnn/src/caffe/caffe_io.cpp | ||
116 | +++ b/modules/dnn/src/caffe/caffe_io.cpp | ||
117 | @@ -1130,7 +1130,17 @@ bool ReadProtoFromTextFile(const char* filename, Message* proto) { | ||
118 | parser.AllowUnknownField(true); | ||
119 | parser.SetRecursionLimit(1000); | ||
120 | #endif | ||
121 | - return parser.Parse(&input, proto); | ||
122 | + const bool ret = parser.Parse(&input, proto); | ||
123 | + | ||
124 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
125 | + if(!ret) | ||
126 | + { | ||
127 | + LOG(ERROR) << "Some data requires patched protobuf (available in OpenCV source tree only)."; | ||
128 | + CV_Error_(Error::StsError,("Some data requires patched protobuf (available in OpenCV source tree only).")); | ||
129 | + } | ||
130 | +#endif | ||
131 | + | ||
132 | + return ret; | ||
133 | } | ||
134 | |||
135 | bool ReadProtoFromBinaryFile(const char* filename, Message* proto) { | ||
136 | @@ -1148,7 +1158,17 @@ bool ReadProtoFromTextBuffer(const char* data, size_t len, Message* proto) { | ||
137 | parser.AllowUnknownField(true); | ||
138 | parser.SetRecursionLimit(1000); | ||
139 | #endif | ||
140 | - return parser.Parse(&input, proto); | ||
141 | + const bool ret = parser.Parse(&input, proto); | ||
142 | + | ||
143 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
144 | + if(!ret) | ||
145 | + { | ||
146 | + LOG(ERROR) << "Some data requires patched protobuf (available in OpenCV source tree only)."; | ||
147 | + CV_Error_(Error::StsError,("Some data requires patched protobuf (available in OpenCV source tree only).")); | ||
148 | + } | ||
149 | +#endif | ||
150 | + | ||
151 | + return ret; | ||
152 | } | ||
153 | |||
154 | |||
155 | diff --git a/modules/dnn/test/test_layers.cpp b/modules/dnn/test/test_layers.cpp | ||
156 | index 763d94b99c..a07d442d76 100644 | ||
157 | --- a/modules/dnn/test/test_layers.cpp | ||
158 | +++ b/modules/dnn/test/test_layers.cpp | ||
159 | @@ -754,7 +754,11 @@ TEST_F(Layer_RNN_Test, get_set_test) | ||
160 | EXPECT_EQ(shape(outputs[1]), shape(nT, nS, nH)); | ||
161 | } | ||
162 | |||
163 | +#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
164 | TEST_P(Test_Caffe_layers, Accum) | ||
165 | +#else | ||
166 | +TEST_P(Test_Caffe_layers, DISABLED_Accum) // requires patched protobuf (available in OpenCV source tree only) | ||
167 | +#endif | ||
168 | { | ||
169 | if (backend == DNN_BACKEND_OPENCV && target != DNN_TARGET_CPU) | ||
170 | applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL, CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); | ||
171 | @@ -778,7 +782,11 @@ TEST_P(Test_Caffe_layers, ChannelNorm) | ||
172 | testLayerUsingCaffeModels("channel_norm", false, false); | ||
173 | } | ||
174 | |||
175 | +#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
176 | TEST_P(Test_Caffe_layers, DataAugmentation) | ||
177 | +#else | ||
178 | +TEST_P(Test_Caffe_layers, DISABLED_DataAugmentation) // requires patched protobuf (available in OpenCV source tree only) | ||
179 | +#endif | ||
180 | { | ||
181 | if (backend == DNN_BACKEND_OPENCV && target == DNN_TARGET_OPENCL_FP16) | ||
182 | applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); | ||
183 | @@ -787,7 +795,11 @@ TEST_P(Test_Caffe_layers, DataAugmentation) | ||
184 | testLayerUsingCaffeModels("data_augmentation_8x6", true, false); | ||
185 | } | ||
186 | |||
187 | +#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
188 | TEST_P(Test_Caffe_layers, Resample) | ||
189 | +#else | ||
190 | +TEST_P(Test_Caffe_layers, DISABLED_Resample) // requires patched protobuf (available in OpenCV source tree only) | ||
191 | +#endif | ||
192 | { | ||
193 | if (backend != DNN_BACKEND_OPENCV) | ||
194 | applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH); | ||
195 | @@ -795,7 +807,11 @@ TEST_P(Test_Caffe_layers, Resample) | ||
196 | testLayerUsingCaffeModels("nearest", false, false); | ||
197 | } | ||
198 | |||
199 | +#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
200 | TEST_P(Test_Caffe_layers, Correlation) | ||
201 | +#else | ||
202 | +TEST_P(Test_Caffe_layers, DISABLED_Correlation) // requires patched protobuf (available in OpenCV source tree only) | ||
203 | +#endif | ||
204 | { | ||
205 | if (backend == DNN_BACKEND_OPENCV && target == DNN_TARGET_OPENCL_FP16) | ||
206 | applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, | ||
207 | From 2c33798f41942aefc203183d673ce4846f32dba4 Mon Sep 17 00:00:00 2001 | ||
208 | From: Kumataro <Kumataro@users.noreply.github.com> | ||
209 | Date: Sun, 8 Oct 2023 13:28:40 +0900 | ||
210 | Subject: [PATCH] use GREATER instead of GREATER_EQUAL and remove new blank | ||
211 | line at EOF | ||
212 | |||
213 | --- | ||
214 | cmake/OpenCVFindProtobuf.cmake | 6 ++++-- | ||
215 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
216 | |||
217 | diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake | ||
218 | index 9bd5c28db8..ba147526d6 100644 | ||
219 | --- a/cmake/OpenCVFindProtobuf.cmake | ||
220 | +++ b/cmake/OpenCVFindProtobuf.cmake | ||
221 | @@ -71,12 +71,14 @@ endif() | ||
222 | # In Protocol Buffers v22.0 and later drops C++11 support and depends abseil-cpp. | ||
223 | # Details: https://protobuf.dev/news/2022-08-03/ | ||
224 | # And if std::text_view is in abseil-cpp requests C++17 and later. | ||
225 | + | ||
226 | if(HAVE_PROTOBUF) | ||
227 | if("${Protobuf_VERSION}" MATCHES [[[0-9]+.([0-9]+).[0-9]+]]) | ||
228 | - string(COMPARE GREATER_EQUAL "${CMAKE_MATCH_1}" "22" REQUEST_ABSL) | ||
229 | + string(COMPARE GREATER "${CMAKE_MATCH_1}" "21" REQUEST_ABSL) # >=22 | ||
230 | |||
231 | if(REQUEST_ABSL) | ||
232 | - string(COMPARE GREATER_EQUAL "${CMAKE_CXX_STANDARD}" "17" USED_AFTER_CXX17) | ||
233 | + string(COMPARE GREATER "${CMAKE_CXX_STANDARD}" "16" USED_AFTER_CXX17) # >=17 | ||
234 | + | ||
235 | if(NOT USED_AFTER_CXX17) | ||
236 | message("CMAKE_CXX_STANDARD : ${CMAKE_CXX_STANDARD}") | ||
237 | message("protobuf : ${Protobuf_VERSION}") | ||
238 | From cd709eefbeedd116bf3495b42280323b932791ff Mon Sep 17 00:00:00 2001 | ||
239 | From: Kumataro <Kumataro@users.noreply.github.com> | ||
240 | Date: Mon, 9 Oct 2023 21:51:04 +0900 | ||
241 | Subject: [PATCH] fix for review | ||
242 | |||
243 | --- | ||
244 | cmake/OpenCVFindProtobuf.cmake | 5 ---- | ||
245 | modules/dnn/src/caffe/caffe_io.cpp | 24 ++---------------- | ||
246 | modules/dnn/test/test_layers.cpp | 40 +++++++++++++++--------------- | ||
247 | 3 files changed, 22 insertions(+), 47 deletions(-) | ||
248 | |||
249 | diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake | ||
250 | index ba147526d6..2faf1010bf 100644 | ||
251 | --- a/cmake/OpenCVFindProtobuf.cmake | ||
252 | +++ b/cmake/OpenCVFindProtobuf.cmake | ||
253 | @@ -123,8 +123,3 @@ if(HAVE_PROTOBUF) | ||
254 | BUILD_PROTOBUF THEN "build (${Protobuf_VERSION})" | ||
255 | ELSE "${__location} (${Protobuf_VERSION})") | ||
256 | endif() | ||
257 | - | ||
258 | -if(HAVE_ABSL_STRINGS AND HAVE_ABSL_LOG) | ||
259 | - list(APPEND CUSTOM_STATUS absl) | ||
260 | - list(APPEND CUSTOM_STATUS_absl " abseil-cpp:" "YES (${ABSL_STRINGS_VERSION})" ) | ||
261 | -endif() | ||
262 | diff --git a/modules/dnn/src/caffe/caffe_io.cpp b/modules/dnn/src/caffe/caffe_io.cpp | ||
263 | index ebceca84cf..ebecf95eea 100644 | ||
264 | --- a/modules/dnn/src/caffe/caffe_io.cpp | ||
265 | +++ b/modules/dnn/src/caffe/caffe_io.cpp | ||
266 | @@ -1130,17 +1130,7 @@ bool ReadProtoFromTextFile(const char* filename, Message* proto) { | ||
267 | parser.AllowUnknownField(true); | ||
268 | parser.SetRecursionLimit(1000); | ||
269 | #endif | ||
270 | - const bool ret = parser.Parse(&input, proto); | ||
271 | - | ||
272 | -#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
273 | - if(!ret) | ||
274 | - { | ||
275 | - LOG(ERROR) << "Some data requires patched protobuf (available in OpenCV source tree only)."; | ||
276 | - CV_Error_(Error::StsError,("Some data requires patched protobuf (available in OpenCV source tree only).")); | ||
277 | - } | ||
278 | -#endif | ||
279 | - | ||
280 | - return ret; | ||
281 | + return parser.Parse(&input, proto); | ||
282 | } | ||
283 | |||
284 | bool ReadProtoFromBinaryFile(const char* filename, Message* proto) { | ||
285 | @@ -1158,17 +1148,7 @@ bool ReadProtoFromTextBuffer(const char* data, size_t len, Message* proto) { | ||
286 | parser.AllowUnknownField(true); | ||
287 | parser.SetRecursionLimit(1000); | ||
288 | #endif | ||
289 | - const bool ret = parser.Parse(&input, proto); | ||
290 | - | ||
291 | -#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
292 | - if(!ret) | ||
293 | - { | ||
294 | - LOG(ERROR) << "Some data requires patched protobuf (available in OpenCV source tree only)."; | ||
295 | - CV_Error_(Error::StsError,("Some data requires patched protobuf (available in OpenCV source tree only).")); | ||
296 | - } | ||
297 | -#endif | ||
298 | - | ||
299 | - return ret; | ||
300 | + return parser.Parse(&input, proto); | ||
301 | } | ||
302 | |||
303 | |||
304 | diff --git a/modules/dnn/test/test_layers.cpp b/modules/dnn/test/test_layers.cpp | ||
305 | index a07d442d76..5c6fc541d7 100644 | ||
306 | --- a/modules/dnn/test/test_layers.cpp | ||
307 | +++ b/modules/dnn/test/test_layers.cpp | ||
308 | @@ -754,17 +754,17 @@ TEST_F(Layer_RNN_Test, get_set_test) | ||
309 | EXPECT_EQ(shape(outputs[1]), shape(nT, nS, nH)); | ||
310 | } | ||
311 | |||
312 | -#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
313 | TEST_P(Test_Caffe_layers, Accum) | ||
314 | -#else | ||
315 | -TEST_P(Test_Caffe_layers, DISABLED_Accum) // requires patched protobuf (available in OpenCV source tree only) | ||
316 | -#endif | ||
317 | { | ||
318 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
319 | + throw SkipTestException("Requires patched protobuf"); | ||
320 | +#else | ||
321 | if (backend == DNN_BACKEND_OPENCV && target != DNN_TARGET_CPU) | ||
322 | applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL, CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); | ||
323 | |||
324 | testLayerUsingCaffeModels("accum", false, false, 0.0, 0.0, 2); | ||
325 | testLayerUsingCaffeModels("accum_ref", false, false, 0.0, 0.0, 2); | ||
326 | +#endif | ||
327 | } | ||
328 | |||
329 | TEST_P(Test_Caffe_layers, FlowWarp) | ||
330 | @@ -782,42 +782,42 @@ TEST_P(Test_Caffe_layers, ChannelNorm) | ||
331 | testLayerUsingCaffeModels("channel_norm", false, false); | ||
332 | } | ||
333 | |||
334 | -#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
335 | TEST_P(Test_Caffe_layers, DataAugmentation) | ||
336 | -#else | ||
337 | -TEST_P(Test_Caffe_layers, DISABLED_DataAugmentation) // requires patched protobuf (available in OpenCV source tree only) | ||
338 | -#endif | ||
339 | { | ||
340 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
341 | + throw SkipTestException("Requires patched protobuf"); | ||
342 | +#else | ||
343 | if (backend == DNN_BACKEND_OPENCV && target == DNN_TARGET_OPENCL_FP16) | ||
344 | applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); | ||
345 | testLayerUsingCaffeModels("data_augmentation", true, false); | ||
346 | testLayerUsingCaffeModels("data_augmentation_2x1", true, false); | ||
347 | testLayerUsingCaffeModels("data_augmentation_8x6", true, false); | ||
348 | +#endif | ||
349 | } | ||
350 | |||
351 | -#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
352 | TEST_P(Test_Caffe_layers, Resample) | ||
353 | -#else | ||
354 | -TEST_P(Test_Caffe_layers, DISABLED_Resample) // requires patched protobuf (available in OpenCV source tree only) | ||
355 | -#endif | ||
356 | { | ||
357 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
358 | + throw SkipTestException("Requires patched protobuf"); | ||
359 | +#else | ||
360 | if (backend != DNN_BACKEND_OPENCV) | ||
361 | applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH); | ||
362 | testLayerUsingCaffeModels("nearest_2inps", false, false, 0.0, 0.0, 2); | ||
363 | testLayerUsingCaffeModels("nearest", false, false); | ||
364 | +#endif | ||
365 | } | ||
366 | |||
367 | -#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
368 | TEST_P(Test_Caffe_layers, Correlation) | ||
369 | -#else | ||
370 | -TEST_P(Test_Caffe_layers, DISABLED_Correlation) // requires patched protobuf (available in OpenCV source tree only) | ||
371 | -#endif | ||
372 | { | ||
373 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
374 | + throw SkipTestException("Requires patched protobuf"); | ||
375 | +#else | ||
376 | if (backend == DNN_BACKEND_OPENCV && target == DNN_TARGET_OPENCL_FP16) | ||
377 | applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, | ||
378 | CV_TEST_TAG_DNN_SKIP_OPENCL, CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); | ||
379 | testLayerUsingCaffeModels("correlation", false, false, 0.0, 0.0, 2); | ||
380 | } | ||
381 | +#endif | ||
382 | |||
383 | TEST_P(Test_Caffe_layers, Convolution2Inputs) | ||
384 | { | ||
385 | @@ -1644,12 +1644,11 @@ private: | ||
386 | int outWidth, outHeight, zoomFactor; | ||
387 | }; | ||
388 | |||
389 | -#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
390 | TEST_P(Test_Caffe_layers, Interp) | ||
391 | -#else | ||
392 | -TEST_P(Test_Caffe_layers, DISABLED_Interp) // requires patched protobuf (available in OpenCV source tree only) | ||
393 | -#endif | ||
394 | { | ||
395 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
396 | + throw SkipTestException("Requires patched protobuf"); | ||
397 | +#else | ||
398 | #if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2022010000) | ||
399 | // Cannot get memory! | ||
400 | if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && target == DNN_TARGET_CPU) | ||
401 | @@ -1686,6 +1685,7 @@ TEST_P(Test_Caffe_layers, DISABLED_Interp) // requires patched protobuf (availa | ||
402 | |||
403 | // Test an implemented layer. | ||
404 | testLayerUsingCaffeModels("layer_interp", false, false); | ||
405 | +#endif | ||
406 | } | ||
407 | |||
408 | INSTANTIATE_TEST_CASE_P(/*nothing*/, Test_Caffe_layers, dnnBackendsAndTargets()); | ||
diff --git a/recipes-support/opencv/opencv_4.6.0.imx.bb b/recipes-support/opencv/opencv_4.6.0.imx.bb index efb29c16..6d13d107 100644 --- a/recipes-support/opencv/opencv_4.6.0.imx.bb +++ b/recipes-support/opencv/opencv_4.6.0.imx.bb | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | ########## meta-openembedded copy ########### | 5 | ########## meta-openembedded copy ########### |
6 | # Upstream hash: 72dc42966be7da07f9553f75b825123b81704f0b | 6 | # Upstream hash: 72dc42966be7da07f9553f75b825123b81704f0b |
7 | # Commit https://github.com/openembedded/meta-openembedded/commit/225ce6a14a8110ab6b573b4dc9f5297a03d17e0f added | ||
7 | 8 | ||
8 | SUMMARY = "Opencv : The Open Computer Vision Library" | 9 | SUMMARY = "Opencv : The Open Computer Vision Library" |
9 | HOMEPAGE = "http://opencv.org/" | 10 | HOMEPAGE = "http://opencv.org/" |
@@ -59,6 +60,7 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv;branch=master;protocol | |||
59 | file://download.patch \ | 60 | file://download.patch \ |
60 | file://0001-Make-ts-module-external.patch \ | 61 | file://0001-Make-ts-module-external.patch \ |
61 | file://0001-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch \ | 62 | file://0001-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch \ |
63 | file://fix-build-with-protobuf-v22.patch \ | ||
62 | " | 64 | " |
63 | SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=contrib" | 65 | SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=contrib" |
64 | 66 | ||
@@ -128,7 +130,7 @@ PACKAGECONFIG:remove:libc-musl:riscv32 = "tbb" | |||
128 | PACKAGECONFIG[gapi] = "-DWITH_ADE=ON -Dade_DIR=${STAGING_LIBDIR},-DWITH_ADE=OFF,ade" | 130 | PACKAGECONFIG[gapi] = "-DWITH_ADE=ON -Dade_DIR=${STAGING_LIBDIR},-DWITH_ADE=OFF,ade" |
129 | PACKAGECONFIG[amdblas] = "-DWITH_OPENCLAMDBLAS=ON,-DWITH_OPENCLAMDBLAS=OFF,libclamdblas," | 131 | PACKAGECONFIG[amdblas] = "-DWITH_OPENCLAMDBLAS=ON,-DWITH_OPENCLAMDBLAS=OFF,libclamdblas," |
130 | PACKAGECONFIG[amdfft] = "-DWITH_OPENCLAMDFFT=ON,-DWITH_OPENCLAMDFFT=OFF,libclamdfft," | 132 | PACKAGECONFIG[amdfft] = "-DWITH_OPENCLAMDFFT=ON,-DWITH_OPENCLAMDFFT=OFF,libclamdfft," |
131 | PACKAGECONFIG[dnn] = "-DBUILD_opencv_dnn=ON -DPROTOBUF_UPDATE_FILES=ON -DBUILD_PROTOBUF=OFF,-DBUILD_opencv_dnn=OFF,protobuf protobuf-native," | 133 | PACKAGECONFIG[dnn] = "-DBUILD_opencv_dnn=ON -DPROTOBUF_UPDATE_FILES=ON -DBUILD_PROTOBUF=OFF -DCMAKE_CXX_STANDARD=17,-DBUILD_opencv_dnn=OFF,protobuf protobuf-native," |
132 | PACKAGECONFIG[eigen] = "-DWITH_EIGEN=ON,-DWITH_EIGEN=OFF,libeigen gflags glog," | 134 | PACKAGECONFIG[eigen] = "-DWITH_EIGEN=ON,-DWITH_EIGEN=OFF,libeigen gflags glog," |
133 | PACKAGECONFIG[freetype] = "-DBUILD_opencv_freetype=ON,-DBUILD_opencv_freetype=OFF,freetype," | 135 | PACKAGECONFIG[freetype] = "-DBUILD_opencv_freetype=ON,-DBUILD_opencv_freetype=OFF,freetype," |
134 | PACKAGECONFIG[gphoto2] = "-DWITH_GPHOTO2=ON,-DWITH_GPHOTO2=OFF,libgphoto2," | 136 | PACKAGECONFIG[gphoto2] = "-DWITH_GPHOTO2=ON,-DWITH_GPHOTO2=OFF,libgphoto2," |