mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 20:50:25 +08:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
commit
0cf479dd5c
2
3rdparty/zlib/zutil.c
vendored
2
3rdparty/zlib/zutil.c
vendored
@ -136,7 +136,7 @@ const char * ZEXPORT zError(err)
|
||||
return ERR_MSG(err);
|
||||
}
|
||||
|
||||
#if defined(_WIN32_WCE)
|
||||
#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800
|
||||
/* The Microsoft C Run-Time Library for Windows CE doesn't have
|
||||
* errno. We define it as a global variable to simplify porting.
|
||||
* Its value is always 0 and should not be used.
|
||||
|
2
3rdparty/zlib/zutil.h
vendored
2
3rdparty/zlib/zutil.h
vendored
@ -169,11 +169,13 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||
|
||||
#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
|
||||
# if defined(_WIN32_WCE)
|
||||
# if _WIN32_WCE < 0x800
|
||||
# define fdopen(fd,mode) NULL /* No fdopen() */
|
||||
# ifndef _PTRDIFF_T_DEFINED
|
||||
typedef int ptrdiff_t;
|
||||
# define _PTRDIFF_T_DEFINED
|
||||
# endif
|
||||
# endif
|
||||
# else
|
||||
# define fdopen(fd,type) _fdopen(fd,type)
|
||||
# endif
|
||||
|
@ -53,35 +53,6 @@ if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
|
||||
set(WINRT TRUE)
|
||||
endif()
|
||||
|
||||
if(WINRT)
|
||||
add_definitions(-DWINRT -DNO_GETENV)
|
||||
|
||||
# Making definitions available to other configurations and
|
||||
# to filter dependency restrictions at compile time.
|
||||
if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone)
|
||||
set(WINRT_PHONE TRUE)
|
||||
add_definitions(-DWINRT_PHONE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES WindowsStore)
|
||||
set(WINRT_STORE TRUE)
|
||||
add_definitions(-DWINRT_STORE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_VERSION MATCHES 10)
|
||||
set(WINRT_10 TRUE)
|
||||
add_definitions(-DWINRT_10)
|
||||
elseif(CMAKE_SYSTEM_VERSION MATCHES 8.1)
|
||||
set(WINRT_8_1 TRUE)
|
||||
add_definitions(-DWINRT_8_1)
|
||||
elseif(CMAKE_SYSTEM_VERSION MATCHES 8.0)
|
||||
set(WINRT_8_0 TRUE)
|
||||
add_definitions(-DWINRT_8_0)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0026)
|
||||
cmake_policy(SET CMP0026 NEW)
|
||||
endif()
|
||||
@ -136,6 +107,39 @@ enable_testing()
|
||||
|
||||
project(OpenCV CXX C)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
|
||||
set(WINRT TRUE)
|
||||
endif()
|
||||
|
||||
if(WINRT OR WINCE)
|
||||
add_definitions(-DNO_GETENV)
|
||||
endif()
|
||||
|
||||
if(WINRT)
|
||||
add_definitions(-DWINRT)
|
||||
|
||||
# Making definitions available to other configurations and
|
||||
# to filter dependency restrictions at compile time.
|
||||
if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone)
|
||||
set(WINRT_PHONE TRUE)
|
||||
add_definitions(-DWINRT_PHONE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES WindowsStore)
|
||||
set(WINRT_STORE TRUE)
|
||||
add_definitions(-DWINRT_STORE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_VERSION MATCHES 10)
|
||||
set(WINRT_10 TRUE)
|
||||
add_definitions(-DWINRT_10)
|
||||
elseif(CMAKE_SYSTEM_VERSION MATCHES 8.1)
|
||||
set(WINRT_8_1 TRUE)
|
||||
add_definitions(-DWINRT_8_1)
|
||||
elseif(CMAKE_SYSTEM_VERSION MATCHES 8.0)
|
||||
set(WINRT_8_0 TRUE)
|
||||
add_definitions(-DWINRT_8_0)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set(CMAKE_USE_RELATIVE_PATHS ON CACHE INTERNAL "" FORCE)
|
||||
endif()
|
||||
|
@ -80,9 +80,9 @@ endif()
|
||||
|
||||
if(INF_ENGINE_TARGET)
|
||||
if(NOT INF_ENGINE_RELEASE)
|
||||
message(WARNING "InferenceEngine version have not been set, 2019R1 will be used by default. Set INF_ENGINE_RELEASE variable if you experience build errors.")
|
||||
message(WARNING "InferenceEngine version have not been set, 2019R2 will be used by default. Set INF_ENGINE_RELEASE variable if you experience build errors.")
|
||||
endif()
|
||||
set(INF_ENGINE_RELEASE "2019010000" CACHE STRING "Force IE version, should be in form YYYYAABBCC (e.g. 2018R2.0.2 -> 2018020002)")
|
||||
set(INF_ENGINE_RELEASE "2019020000" CACHE STRING "Force IE version, should be in form YYYYAABBCC (e.g. 2018R2.0.2 -> 2018020002)")
|
||||
set_target_properties(${INF_ENGINE_TARGET} PROPERTIES
|
||||
INTERFACE_COMPILE_DEFINITIONS "HAVE_INF_ENGINE=1;INF_ENGINE_RELEASE=${INF_ENGINE_RELEASE}"
|
||||
)
|
||||
|
88
modules/core/include/opencv2/core/simd_intrinsics.hpp
Normal file
88
modules/core/include/opencv2/core/simd_intrinsics.hpp
Normal file
@ -0,0 +1,88 @@
|
||||
// This file is part of OpenCV project.
|
||||
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||
// of this distribution and at http://opencv.org/license.html.
|
||||
|
||||
#ifndef OPENCV_CORE_SIMD_INTRINSICS_HPP
|
||||
#define OPENCV_CORE_SIMD_INTRINSICS_HPP
|
||||
|
||||
/**
|
||||
Helper header to support SIMD intrinsics (universal intrinsics) in user code.
|
||||
Intrinsics documentation: https://docs.opencv.org/3.4/df/d91/group__core__hal__intrin.html
|
||||
|
||||
|
||||
Checks of target CPU instruction set based on compiler definitions don't work well enough.
|
||||
More reliable solutions require utilization of configuration systems (like CMake).
|
||||
|
||||
So, probably you need to specify your own configuration.
|
||||
|
||||
You can do that via CMake in this way:
|
||||
add_definitions(/DOPENCV_SIMD_CONFIG_HEADER=opencv_simd_config_custom.hpp)
|
||||
or
|
||||
add_definitions(/DOPENCV_SIMD_CONFIG_INCLUDE_DIR=1)
|
||||
|
||||
Additionally you may need to add include directory to your files:
|
||||
include_directories("${CMAKE_CURRENT_LIST_DIR}/opencv_config_${MYTARGET}")
|
||||
|
||||
These files can be pre-generated for target configurations of your application
|
||||
or generated by CMake on the fly (use CMAKE_BINARY_DIR for that).
|
||||
|
||||
Notes:
|
||||
- H/W capability checks are still responsibility of your applcation
|
||||
- runtime dispatching is not covered by this helper header
|
||||
*/
|
||||
|
||||
#ifdef __OPENCV_BUILD
|
||||
#error "Use core/hal/intrin.hpp during OpenCV build"
|
||||
#endif
|
||||
|
||||
#ifdef OPENCV_HAL_INTRIN_HPP
|
||||
#error "core/simd_intrinsics.hpp must be included before core/hal/intrin.hpp"
|
||||
#endif
|
||||
|
||||
#include "opencv2/core/cvdef.h"
|
||||
#include "opencv2/core/version.hpp"
|
||||
|
||||
#ifdef OPENCV_SIMD_CONFIG_HEADER
|
||||
#include CVAUX_STR(OPENCV_SIMD_CONFIG_HEADER)
|
||||
#elif defined(OPENCV_SIMD_CONFIG_INCLUDE_DIR)
|
||||
#include "opencv_simd_config.hpp" // corresponding directory should be added via -I compiler parameter
|
||||
#else // custom config headers
|
||||
|
||||
#if (!defined(CV_AVX_512F) || !CV_AVX_512F) && (defined(__AVX512__) || defined(__AVX512F__))
|
||||
# include <immintrin.h>
|
||||
# undef CV_AVX_512F
|
||||
# define CV_AVX_512F 1
|
||||
# ifndef OPENCV_SIMD_DONT_ASSUME_SKX // Skylake-X with AVX-512F/CD/BW/DQ/VL
|
||||
# undef CV_AVX512_SKX
|
||||
# define CV_AVX512_SKX 1
|
||||
# undef CV_AVX_512CD
|
||||
# define CV_AVX_512CD 1
|
||||
# undef CV_AVX_512BW
|
||||
# define CV_AVX_512BW 1
|
||||
# undef CV_AVX_512DQ
|
||||
# define CV_AVX_512DQ 1
|
||||
# undef CV_AVX_512VL
|
||||
# define CV_AVX_512VL 1
|
||||
# endif
|
||||
#endif // AVX512
|
||||
|
||||
// GCC/Clang: -mavx2
|
||||
// MSVC: /arch:AVX2
|
||||
#if defined __AVX2__
|
||||
# include <immintrin.h>
|
||||
# undef CV_AVX2
|
||||
# define CV_AVX2 1
|
||||
# if defined __F16C__
|
||||
# undef CV_FP16
|
||||
# define CV_FP16 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// SSE / NEON / VSX is handled by cv_cpu_dispatch.h compatibility block
|
||||
#include "cv_cpu_dispatch.h"
|
||||
|
||||
#include "hal/intrin.hpp"
|
||||
|
||||
#endif // OPENCV_CORE_SIMD_INTRINSICS_HPP
|
@ -9,7 +9,7 @@
|
||||
#ifndef OPENCV_HAVE_FILESYSTEM_SUPPORT
|
||||
# if defined(__EMSCRIPTEN__) || defined(__native_client__)
|
||||
/* no support */
|
||||
# elif defined WINRT
|
||||
# elif defined WINRT || defined _WIN32_WCE
|
||||
/* not supported */
|
||||
# elif defined __ANDROID__ || defined __linux__ || defined _WIN32 || \
|
||||
defined __FreeBSD__ || defined __bsdi__ || defined __HAIKU__
|
||||
|
@ -57,7 +57,7 @@ namespace
|
||||
|
||||
struct DIR
|
||||
{
|
||||
#ifdef WINRT
|
||||
#if defined(WINRT) || defined(_WIN32_WCE)
|
||||
WIN32_FIND_DATAW data;
|
||||
#else
|
||||
WIN32_FIND_DATAA data;
|
||||
@ -78,7 +78,7 @@ namespace
|
||||
{
|
||||
DIR* dir = new DIR;
|
||||
dir->ent.d_name = 0;
|
||||
#ifdef WINRT
|
||||
#if defined(WINRT) || defined(_WIN32_WCE)
|
||||
cv::String full_path = cv::String(path) + "\\*";
|
||||
wchar_t wfull_path[MAX_PATH];
|
||||
size_t copied = mbstowcs(wfull_path, full_path.c_str(), MAX_PATH);
|
||||
@ -100,7 +100,7 @@ namespace
|
||||
|
||||
dirent* readdir(DIR* dir)
|
||||
{
|
||||
#ifdef WINRT
|
||||
#if defined(WINRT) || defined(_WIN32_WCE)
|
||||
if (dir->ent.d_name != 0)
|
||||
{
|
||||
if (::FindNextFileW(dir->handle, &dir->data) != TRUE)
|
||||
|
@ -2511,6 +2511,27 @@ double dotProd_32f(const float* src1, const float* src2, int len)
|
||||
|
||||
int j = 0;
|
||||
int cWidth = v_float32::nlanes;
|
||||
|
||||
#if CV_ENABLE_UNROLLED
|
||||
v_float32 v_sum1 = vx_setzero_f32();
|
||||
v_float32 v_sum2 = vx_setzero_f32();
|
||||
v_float32 v_sum3 = vx_setzero_f32();
|
||||
|
||||
for (; j <= blockSize - (cWidth * 4); j += (cWidth * 4))
|
||||
{
|
||||
v_sum = v_muladd(vx_load(src1 + j),
|
||||
vx_load(src2 + j), v_sum);
|
||||
v_sum1 = v_muladd(vx_load(src1 + j + cWidth),
|
||||
vx_load(src2 + j + cWidth), v_sum1);
|
||||
v_sum2 = v_muladd(vx_load(src1 + j + (cWidth * 2)),
|
||||
vx_load(src2 + j + (cWidth * 2)), v_sum2);
|
||||
v_sum3 = v_muladd(vx_load(src1 + j + (cWidth * 3)),
|
||||
vx_load(src2 + j + (cWidth * 3)), v_sum3);
|
||||
}
|
||||
|
||||
v_sum += v_sum1 + v_sum2 + v_sum3;
|
||||
#endif
|
||||
|
||||
for (; j <= blockSize - cWidth; j += cWidth)
|
||||
v_sum = v_muladd(vx_load(src1 + j), vx_load(src2 + j), v_sum);
|
||||
|
||||
|
@ -1722,7 +1722,7 @@ static bool parseOpenCLDeviceConfiguration(const std::string& configurationStr,
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef WINRT
|
||||
#if defined WINRT || defined _WIN32_WCE
|
||||
static cl_device_id selectOpenCLDevice()
|
||||
{
|
||||
return NULL;
|
||||
|
@ -378,7 +378,7 @@ struct HWFeatures
|
||||
|
||||
void initialize(void)
|
||||
{
|
||||
#ifndef WINRT
|
||||
#ifndef NO_GETENV
|
||||
if (getenv("OPENCV_DUMP_CONFIG"))
|
||||
{
|
||||
fprintf(stderr, "\nOpenCV build configuration is:\n%s\n",
|
||||
@ -614,10 +614,10 @@ struct HWFeatures
|
||||
{
|
||||
bool dump = true;
|
||||
const char* disabled_features =
|
||||
#ifndef WINRT
|
||||
getenv("OPENCV_CPU_DISABLE");
|
||||
#else
|
||||
#ifdef NO_GETENV
|
||||
NULL;
|
||||
#else
|
||||
getenv("OPENCV_CPU_DISABLE");
|
||||
#endif
|
||||
if (disabled_features && disabled_features[0] != 0)
|
||||
{
|
||||
@ -889,7 +889,7 @@ String format( const char* fmt, ... )
|
||||
String tempfile( const char* suffix )
|
||||
{
|
||||
String fname;
|
||||
#ifndef WINRT
|
||||
#ifndef NO_GETENV
|
||||
const char *temp_dir = getenv("OPENCV_TEMP_PATH");
|
||||
#endif
|
||||
|
||||
@ -910,6 +910,20 @@ String tempfile( const char* suffix )
|
||||
CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1));
|
||||
fname = String(aname);
|
||||
RoUninitialize();
|
||||
#elif defined(_WIN32_WCE)
|
||||
const auto kMaxPathSize = MAX_PATH+1;
|
||||
wchar_t temp_dir[kMaxPathSize] = {0};
|
||||
wchar_t temp_file[kMaxPathSize] = {0};
|
||||
|
||||
::GetTempPathW(kMaxPathSize, temp_dir);
|
||||
|
||||
if(0 != ::GetTempFileNameW(temp_dir, L"ocv", 0, temp_file)) {
|
||||
DeleteFileW(temp_file);
|
||||
char aname[MAX_PATH];
|
||||
size_t copied = wcstombs(aname, temp_file, MAX_PATH);
|
||||
CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1));
|
||||
fname = String(aname);
|
||||
}
|
||||
#else
|
||||
char temp_dir2[MAX_PATH] = { 0 };
|
||||
char temp_file[MAX_PATH] = { 0 };
|
||||
|
@ -142,6 +142,8 @@ PERF_TEST_P_(DNNTestNetwork, MobileNet_SSD_v1_TensorFlow)
|
||||
{
|
||||
if (backend == DNN_BACKEND_HALIDE)
|
||||
throw SkipTestException("");
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD)
|
||||
throw SkipTestException("");
|
||||
processNet("dnn/ssd_mobilenet_v1_coco_2017_11_17.pb", "ssd_mobilenet_v1_coco_2017_11_17.pbtxt", "",
|
||||
Mat(cv::Size(300, 300), CV_32FC3));
|
||||
}
|
||||
@ -150,6 +152,8 @@ PERF_TEST_P_(DNNTestNetwork, MobileNet_SSD_v2_TensorFlow)
|
||||
{
|
||||
if (backend == DNN_BACKEND_HALIDE)
|
||||
throw SkipTestException("");
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD)
|
||||
throw SkipTestException("");
|
||||
processNet("dnn/ssd_mobilenet_v2_coco_2018_03_29.pb", "ssd_mobilenet_v2_coco_2018_03_29.pbtxt", "",
|
||||
Mat(cv::Size(300, 300), CV_32FC3));
|
||||
}
|
||||
@ -190,6 +194,11 @@ PERF_TEST_P_(DNNTestNetwork, Inception_v2_SSD_TensorFlow)
|
||||
&& getInferenceEngineVPUType() == CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X)
|
||||
throw SkipTestException("Test is disabled for MyriadX");
|
||||
#endif
|
||||
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019020000)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD)
|
||||
throw SkipTestException("Test is disabled for Myriad in OpenVINO 2019R2");
|
||||
#endif
|
||||
|
||||
processNet("dnn/ssd_inception_v2_coco_2017_11_17.pb", "ssd_inception_v2_coco_2017_11_17.pbtxt", "",
|
||||
Mat(cv::Size(300, 300), CV_32FC3));
|
||||
}
|
||||
@ -223,6 +232,10 @@ PERF_TEST_P_(DNNTestNetwork, Inception_v2_Faster_RCNN)
|
||||
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019010000)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE)
|
||||
throw SkipTestException("Test is disabled in OpenVINO 2019R1");
|
||||
#endif
|
||||
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019020000)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE)
|
||||
throw SkipTestException("Test is disabled in OpenVINO 2019R2");
|
||||
#endif
|
||||
if (backend == DNN_BACKEND_HALIDE ||
|
||||
(backend == DNN_BACKEND_INFERENCE_ENGINE && target != DNN_TARGET_CPU) ||
|
||||
|
@ -21,10 +21,11 @@
|
||||
|
||||
#define INF_ENGINE_RELEASE_2018R5 2018050000
|
||||
#define INF_ENGINE_RELEASE_2019R1 2019010000
|
||||
#define INF_ENGINE_RELEASE_2019R2 2019020000
|
||||
|
||||
#ifndef INF_ENGINE_RELEASE
|
||||
#warning("IE version have not been provided via command-line. Using 2019R1 by default")
|
||||
#define INF_ENGINE_RELEASE INF_ENGINE_RELEASE_2019R1
|
||||
#warning("IE version have not been provided via command-line. Using 2019R2 by default")
|
||||
#define INF_ENGINE_RELEASE INF_ENGINE_RELEASE_2019R2
|
||||
#endif
|
||||
|
||||
#define INF_ENGINE_VER_MAJOR_GT(ver) (((INF_ENGINE_RELEASE) / 10000) > ((ver) / 10000))
|
||||
|
@ -205,6 +205,11 @@ TEST_P(DNNTestNetwork, MobileNet_SSD_v1_TensorFlow)
|
||||
applyTestTag(target == DNN_TARGET_CPU ? "" : CV_TEST_TAG_MEMORY_512MB);
|
||||
if (backend == DNN_BACKEND_HALIDE)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_HALIDE);
|
||||
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019020000)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE, CV_TEST_TAG_DNN_SKIP_IE_2019R2);
|
||||
#endif
|
||||
|
||||
Mat sample = imread(findDataFile("dnn/street.png"));
|
||||
Mat inp = blobFromImage(sample, 1.0f, Size(300, 300), Scalar(), false);
|
||||
float l1 = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD) ? 0.095 : 0.0;
|
||||
@ -224,6 +229,11 @@ TEST_P(DNNTestNetwork, MobileNet_SSD_v1_TensorFlow_Different_Width_Height)
|
||||
&& getInferenceEngineVPUType() == CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD_X);
|
||||
#endif
|
||||
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019020000)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE, CV_TEST_TAG_DNN_SKIP_IE_2019R2);
|
||||
#endif
|
||||
|
||||
Mat sample = imread(findDataFile("dnn/street.png"));
|
||||
Mat inp = blobFromImage(sample, 1.0f, Size(300, 560), Scalar(), false);
|
||||
float l1 = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD) ? 0.012 : 0.0;
|
||||
@ -238,6 +248,11 @@ TEST_P(DNNTestNetwork, MobileNet_SSD_v2_TensorFlow)
|
||||
applyTestTag(target == DNN_TARGET_CPU ? CV_TEST_TAG_MEMORY_512MB : CV_TEST_TAG_MEMORY_1GB);
|
||||
if (backend == DNN_BACKEND_HALIDE)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_HALIDE);
|
||||
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019020000)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE, CV_TEST_TAG_DNN_SKIP_IE_2019R2);
|
||||
#endif
|
||||
|
||||
Mat sample = imread(findDataFile("dnn/street.png"));
|
||||
Mat inp = blobFromImage(sample, 1.0f, Size(300, 300), Scalar(), false);
|
||||
float l1 = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD) ? 0.013 : 2e-5;
|
||||
@ -355,6 +370,10 @@ TEST_P(DNNTestNetwork, Inception_v2_SSD_TensorFlow)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD
|
||||
&& getInferenceEngineVPUType() == CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD_X);
|
||||
#endif
|
||||
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019020000)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE, CV_TEST_TAG_DNN_SKIP_IE_2019R2);
|
||||
#endif
|
||||
if (backend == DNN_BACKEND_HALIDE)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_HALIDE);
|
||||
|
@ -561,7 +561,7 @@ TEST(Test_Caffe, shared_weights)
|
||||
typedef testing::TestWithParam<tuple<std::string, Target> > opencv_face_detector;
|
||||
TEST_P(opencv_face_detector, Accuracy)
|
||||
{
|
||||
std::string proto = findDataFile("dnn/opencv_face_detector.prototxt", false);
|
||||
std::string proto = findDataFile("dnn/opencv_face_detector.prototxt");
|
||||
std::string model = findDataFile(get<0>(GetParam()), false);
|
||||
dnn::Target targetId = (dnn::Target)(int)get<1>(GetParam());
|
||||
|
||||
@ -584,6 +584,29 @@ TEST_P(opencv_face_detector, Accuracy)
|
||||
0, 1, 0.95097077, 0.51901293, 0.45863652, 0.5777427, 0.5347801);
|
||||
normAssertDetections(ref, out, "", 0.5, 1e-5, 2e-4);
|
||||
}
|
||||
|
||||
// False positives bug for large faces: https://github.com/opencv/opencv/issues/15106
|
||||
TEST_P(opencv_face_detector, issue_15106)
|
||||
{
|
||||
std::string proto = findDataFile("dnn/opencv_face_detector.prototxt");
|
||||
std::string model = findDataFile(get<0>(GetParam()), false);
|
||||
dnn::Target targetId = (dnn::Target)(int)get<1>(GetParam());
|
||||
|
||||
Net net = readNetFromCaffe(proto, model);
|
||||
Mat img = imread(findDataFile("cv/shared/lena.png"));
|
||||
img = img.rowRange(img.rows / 4, 3 * img.rows / 4).colRange(img.cols / 4, 3 * img.cols / 4);
|
||||
Mat blob = blobFromImage(img, 1.0, Size(300, 300), Scalar(104.0, 177.0, 123.0), false, false);
|
||||
|
||||
net.setPreferableBackend(DNN_BACKEND_OPENCV);
|
||||
net.setPreferableTarget(targetId);
|
||||
|
||||
net.setInput(blob);
|
||||
// Output has shape 1x1xNx7 where N - number of detections.
|
||||
// An every detection is a vector of values [id, classId, confidence, left, top, right, bottom]
|
||||
Mat out = net.forward();
|
||||
Mat ref = (Mat_<float>(1, 7) << 0, 1, 0.9149431, 0.30424616, 0.26964942, 0.88733053, 0.99815309);
|
||||
normAssertDetections(ref, out, "", 0.2, 6e-5, 1e-4);
|
||||
}
|
||||
INSTANTIATE_TEST_CASE_P(Test_Caffe, opencv_face_detector,
|
||||
Combine(
|
||||
Values("dnn/opencv_face_detector.caffemodel",
|
||||
|
@ -18,6 +18,7 @@
|
||||
#define CV_TEST_TAG_DNN_SKIP_IE_2018R5 "dnn_skip_ie_2018r5"
|
||||
#define CV_TEST_TAG_DNN_SKIP_IE_2019R1 "dnn_skip_ie_2019r1"
|
||||
#define CV_TEST_TAG_DNN_SKIP_IE_2019R1_1 "dnn_skip_ie_2019r1_1"
|
||||
#define CV_TEST_TAG_DNN_SKIP_IE_2019R2 "dnn_skip_ie_2019r2"
|
||||
#define CV_TEST_TAG_DNN_SKIP_IE_OPENCL "dnn_skip_ie_ocl"
|
||||
#define CV_TEST_TAG_DNN_SKIP_IE_OPENCL_FP16 "dnn_skip_ie_ocl_fp16"
|
||||
#define CV_TEST_TAG_DNN_SKIP_IE_MYRIAD_2 "dnn_skip_ie_myriad2"
|
||||
|
@ -319,8 +319,11 @@ void initDNNTests()
|
||||
CV_TEST_TAG_DNN_SKIP_IE_2018R5,
|
||||
#elif INF_ENGINE_VER_MAJOR_EQ(2019010000)
|
||||
CV_TEST_TAG_DNN_SKIP_IE_2019R1,
|
||||
#elif INF_ENGINE_VER_MAJOR_EQ(2019010100)
|
||||
CV_TEST_TAG_DNN_SKIP_IE_2019R1_1
|
||||
# if INF_ENGINE_RELEASE == 2019010100
|
||||
CV_TEST_TAG_DNN_SKIP_IE_2019R1_1,
|
||||
# endif
|
||||
#elif INF_ENGINE_VER_MAJOR_EQ(2019020000)
|
||||
CV_TEST_TAG_DNN_SKIP_IE_2019R2,
|
||||
#endif
|
||||
CV_TEST_TAG_DNN_SKIP_IE
|
||||
);
|
||||
|
@ -9,10 +9,32 @@
|
||||
#ifdef HAVE_INF_ENGINE
|
||||
#include <opencv2/core/utils/filesystem.hpp>
|
||||
|
||||
|
||||
//
|
||||
// Synchronize headers include statements with src/op_inf_engine.hpp
|
||||
//
|
||||
//#define INFERENCE_ENGINE_DEPRECATED // turn off deprecation warnings from IE
|
||||
//there is no way to suppress warnigns from IE only at this moment, so we are forced to suppress warnings globally
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable: 4996) // was declared deprecated
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#include <inference_engine.hpp>
|
||||
#include <ie_icnn_network.hpp>
|
||||
#include <ie_extension.h>
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
|
||||
namespace opencv_test { namespace {
|
||||
|
||||
static void initDLDTDataPath()
|
||||
|
@ -357,7 +357,7 @@ TEST_P(Test_TensorFlow_nets, MobileNet_SSD)
|
||||
#if defined(INF_ENGINE_RELEASE)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD)
|
||||
{
|
||||
#if INF_ENGINE_VER_MAJOR_GE(2019010000)
|
||||
#if INF_ENGINE_VER_MAJOR_EQ(2019010000)
|
||||
if (getInferenceEngineVPUType() == CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD_X);
|
||||
#else
|
||||
@ -395,12 +395,16 @@ TEST_P(Test_TensorFlow_nets, MobileNet_SSD)
|
||||
TEST_P(Test_TensorFlow_nets, Inception_v2_SSD)
|
||||
{
|
||||
applyTestTag(target == DNN_TARGET_CPU ? CV_TEST_TAG_MEMORY_512MB : CV_TEST_TAG_MEMORY_1GB);
|
||||
|
||||
#if defined(INF_ENGINE_RELEASE)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD
|
||||
&& getInferenceEngineVPUType() == CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X
|
||||
)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD)
|
||||
{
|
||||
#if INF_ENGINE_VER_MAJOR_LE(2019010000)
|
||||
if (getInferenceEngineVPUType() == CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD_X);
|
||||
#else
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
checkBackend();
|
||||
@ -432,6 +436,11 @@ TEST_P(Test_TensorFlow_nets, Inception_v2_SSD)
|
||||
|
||||
TEST_P(Test_TensorFlow_nets, MobileNet_v1_SSD)
|
||||
{
|
||||
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019020000)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE, CV_TEST_TAG_DNN_SKIP_IE_2019R2);
|
||||
#endif
|
||||
|
||||
checkBackend();
|
||||
std::string proto = findDataFile("dnn/ssd_mobilenet_v1_coco_2017_11_17.pbtxt");
|
||||
std::string model = findDataFile("dnn/ssd_mobilenet_v1_coco_2017_11_17.pb", false);
|
||||
@ -506,6 +515,10 @@ TEST_P(Test_TensorFlow_nets, MobileNet_v1_SSD_PPN)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && (target == DNN_TARGET_OPENCL || target == DNN_TARGET_OPENCL_FP16))
|
||||
applyTestTag(target == DNN_TARGET_OPENCL ? CV_TEST_TAG_DNN_SKIP_IE_OPENCL : CV_TEST_TAG_DNN_SKIP_IE_OPENCL_FP16);
|
||||
#endif
|
||||
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019020000)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE, CV_TEST_TAG_DNN_SKIP_IE_2019R2);
|
||||
#endif
|
||||
|
||||
checkBackend();
|
||||
std::string proto = findDataFile("dnn/ssd_mobilenet_v1_ppn_coco.pbtxt");
|
||||
|
@ -46,6 +46,10 @@
|
||||
#include "cascadedetect.hpp"
|
||||
#include "opencl_kernels_objdetect.hpp"
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma warning(disable:4458) // declaration of 'origWinSize' hides class member
|
||||
#endif
|
||||
|
||||
namespace cv
|
||||
{
|
||||
|
||||
@ -536,7 +540,7 @@ bool FeatureEvaluator::setImage( InputArray _image, const std::vector<float>& _s
|
||||
|
||||
//---------------------------------------------- HaarEvaluator ---------------------------------------
|
||||
|
||||
bool HaarEvaluator::Feature :: read( const FileNode& node )
|
||||
bool HaarEvaluator::Feature::read(const FileNode& node, const Size& origWinSize)
|
||||
{
|
||||
FileNode rnode = node[CC_RECTS];
|
||||
FileNodeIterator it = rnode.begin(), it_end = rnode.end();
|
||||
@ -548,11 +552,23 @@ bool HaarEvaluator::Feature :: read( const FileNode& node )
|
||||
rect[ri].weight = 0.f;
|
||||
}
|
||||
|
||||
const int W = origWinSize.width;
|
||||
const int H = origWinSize.height;
|
||||
|
||||
for(ri = 0; it != it_end; ++it, ri++)
|
||||
{
|
||||
FileNodeIterator it2 = (*it).begin();
|
||||
it2 >> rect[ri].r.x >> rect[ri].r.y >>
|
||||
rect[ri].r.width >> rect[ri].r.height >> rect[ri].weight;
|
||||
Feature::RectWeigth& rw = rect[ri];
|
||||
it2 >> rw.r.x >> rw.r.y >> rw.r.width >> rw.r.height >> rw.weight;
|
||||
// input validation
|
||||
{
|
||||
CV_CheckGE(rw.r.x, 0, "Invalid HAAR feature");
|
||||
CV_CheckGE(rw.r.y, 0, "Invalid HAAR feature");
|
||||
CV_CheckLT(rw.r.x, W, "Invalid HAAR feature"); // necessary for overflow checks
|
||||
CV_CheckLT(rw.r.y, H, "Invalid HAAR feature"); // necessary for overflow checks
|
||||
CV_CheckLE(rw.r.x + rw.r.width, W, "Invalid HAAR feature");
|
||||
CV_CheckLE(rw.r.y + rw.r.height, H, "Invalid HAAR feature");
|
||||
}
|
||||
}
|
||||
|
||||
tilted = (int)node[CC_TILTED] != 0;
|
||||
@ -597,7 +613,7 @@ bool HaarEvaluator::read(const FileNode& node, Size _origWinSize)
|
||||
|
||||
for(i = 0; i < n; i++, ++it)
|
||||
{
|
||||
if(!ff[i].read(*it))
|
||||
if(!ff[i].read(*it, _origWinSize))
|
||||
return false;
|
||||
if( ff[i].tilted )
|
||||
hasTiltedFeatures = true;
|
||||
@ -758,11 +774,24 @@ int HaarEvaluator::getSquaresOffset() const
|
||||
}
|
||||
|
||||
//---------------------------------------------- LBPEvaluator -------------------------------------
|
||||
bool LBPEvaluator::Feature :: read(const FileNode& node )
|
||||
bool LBPEvaluator::Feature::read(const FileNode& node, const Size& origWinSize)
|
||||
{
|
||||
FileNode rnode = node[CC_RECT];
|
||||
FileNodeIterator it = rnode.begin();
|
||||
it >> rect.x >> rect.y >> rect.width >> rect.height;
|
||||
|
||||
const int W = origWinSize.width;
|
||||
const int H = origWinSize.height;
|
||||
// input validation
|
||||
{
|
||||
CV_CheckGE(rect.x, 0, "Invalid LBP feature");
|
||||
CV_CheckGE(rect.y, 0, "Invalid LBP feature");
|
||||
CV_CheckLT(rect.x, W, "Invalid LBP feature");
|
||||
CV_CheckLT(rect.y, H, "Invalid LBP feature");
|
||||
CV_CheckLE(rect.x + rect.width, W, "Invalid LBP feature");
|
||||
CV_CheckLE(rect.y + rect.height, H, "Invalid LBP feature");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -796,7 +825,7 @@ bool LBPEvaluator::read( const FileNode& node, Size _origWinSize )
|
||||
std::vector<Feature>& ff = *features;
|
||||
for(int i = 0; it != it_end; ++it, i++)
|
||||
{
|
||||
if(!ff[i].read(*it))
|
||||
if(!ff[i].read(*it, _origWinSize))
|
||||
return false;
|
||||
}
|
||||
nchannels = 1;
|
||||
@ -1441,6 +1470,8 @@ bool CascadeClassifierImpl::Data::read(const FileNode &root)
|
||||
origWinSize.width = (int)root[CC_WIDTH];
|
||||
origWinSize.height = (int)root[CC_HEIGHT];
|
||||
CV_Assert( origWinSize.height > 0 && origWinSize.width > 0 );
|
||||
CV_CheckLE(origWinSize.width, 1000000, "Invalid window size (too large)");
|
||||
CV_CheckLE(origWinSize.height, 1000000, "Invalid window size (too large)");
|
||||
|
||||
// load feature params
|
||||
FileNode fn = root[CC_FEATURE_PARAMS];
|
||||
|
@ -317,12 +317,12 @@ public:
|
||||
struct Feature
|
||||
{
|
||||
Feature();
|
||||
bool read( const FileNode& node );
|
||||
bool read(const FileNode& node, const Size& origWinSize);
|
||||
|
||||
bool tilted;
|
||||
|
||||
enum { RECT_NUM = 3 };
|
||||
struct
|
||||
struct RectWeigth
|
||||
{
|
||||
Rect r;
|
||||
float weight;
|
||||
@ -412,7 +412,7 @@ public:
|
||||
Feature( int x, int y, int _block_w, int _block_h ) :
|
||||
rect(x, y, _block_w, _block_h) {}
|
||||
|
||||
bool read(const FileNode& node );
|
||||
bool read(const FileNode& node, const Size& origWinSize);
|
||||
|
||||
Rect rect; // weight and height for block
|
||||
};
|
||||
|
12
platforms/wince/arm-wince-headless-overrides.cmake
Normal file
12
platforms/wince/arm-wince-headless-overrides.cmake
Normal file
@ -0,0 +1,12 @@
|
||||
if(WINCE)
|
||||
# CommCtrl.lib does not exist in headless WINCE Adding this will make CMake
|
||||
# Try_Compile succeed and therefore also C/C++ ABI Detetection work
|
||||
# https://gitlab.kitware.com/cmake/cmake/blob/master/Modules/Platform/Windows-
|
||||
# MSVC.cmake
|
||||
set(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib")
|
||||
set(CMAKE_CXX_STANDARD_LIBRARIES_INIT ${CMAKE_C_STANDARD_LIBRARIES_INIT})
|
||||
foreach(ID EXE SHARED MODULE)
|
||||
string(APPEND CMAKE_${ID}_LINKER_FLAGS_INIT
|
||||
" /NODEFAULTLIB:libc.lib /NODEFAULTLIB:oldnames.lib")
|
||||
endforeach()
|
||||
endif()
|
35
platforms/wince/arm-wince.toolchain.cmake
Normal file
35
platforms/wince/arm-wince.toolchain.cmake
Normal file
@ -0,0 +1,35 @@
|
||||
set(CMAKE_SYSTEM_NAME WindowsCE)
|
||||
|
||||
if(NOT CMAKE_SYSTEM_VERSION)
|
||||
set(CMAKE_SYSTEM_VERSION 8.0)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_SYSTEM_PROCESSOR)
|
||||
set(CMAKE_SYSTEM_PROCESSOR armv7-a)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_GENERATOR_TOOLSET)
|
||||
set(CMAKE_GENERATOR_TOOLSET CE800)
|
||||
endif()
|
||||
|
||||
# Needed to make try_compile to succeed
|
||||
if(BUILD_HEADLESS)
|
||||
set(CMAKE_USER_MAKE_RULES_OVERRIDE
|
||||
${CMAKE_CURRENT_LIST_DIR}/arm-wince-headless-overrides.cmake)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_FIND_ROOT_PATH_MODE_PROGRAM)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_FIND_ROOT_PATH_MODE_LIBRARY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_FIND_ROOT_PATH_MODE_INCLUDE)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_FIND_ROOT_PATH_MODE_PACKAGE)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
endif()
|
62
platforms/wince/readme.md
Normal file
62
platforms/wince/readme.md
Normal file
@ -0,0 +1,62 @@
|
||||
# Building OpenCV from Source for Windows Embedded Compact (WINCE/WEC)
|
||||
|
||||
## Requirements
|
||||
CMake 3.1.0 or higher
|
||||
Windows Embedded Compact SDK
|
||||
|
||||
## Configuring
|
||||
To configure CMake for Windows Embedded, specify Visual Studio 2013 as generator and the name of your installed SDK:
|
||||
|
||||
`cmake -G "Visual Studio 12 2013" -A "MySDK WEC2013" -DCMAKE_TOOLCHAIN_FILE:FILEPATH=../platforms/wince/arm-wince.toolchain.cmake`
|
||||
|
||||
If you are building for a headless WINCE, specify `-DBUILD_HEADLESS=ON` when configuring. This will remove the `commctrl.lib` dependency.
|
||||
|
||||
If you are building for anything else than WINCE800, you need to specify that in the configuration step. Example:
|
||||
|
||||
```
|
||||
-DCMAKE_SYSTEM_VERSION=7.0 -DCMAKE_GENERATOR_TOOLSET=CE700 -DCMAKE_SYSTEM_PROCESSOR=arm-v4
|
||||
```
|
||||
|
||||
For headless WEC2013, this configuration may not be limited to but is known to work:
|
||||
|
||||
```
|
||||
-DBUILD_EXAMPLES=OFF `
|
||||
-DBUILD_opencv_apps=OFF `
|
||||
-DBUILD_opencv_calib3d=OFF `
|
||||
-DBUILD_opencv_highgui=OFF `
|
||||
-DBUILD_opencv_features2d=OFF `
|
||||
-DBUILD_opencv_flann=OFF `
|
||||
-DBUILD_opencv_ml=OFF `
|
||||
-DBUILD_opencv_objdetect=OFF `
|
||||
-DBUILD_opencv_photo=OFF `
|
||||
-DBUILD_opencv_shape=OFF `
|
||||
-DBUILD_opencv_stitching=OFF `
|
||||
-DBUILD_opencv_superres=OFF `
|
||||
-DBUILD_opencv_ts=OFF `
|
||||
-DBUILD_opencv_video=OFF `
|
||||
-DBUILD_opencv_videoio=OFF `
|
||||
-DBUILD_opencv_videostab=OFF `
|
||||
-DBUILD_opencv_dnn=OFF `
|
||||
-DBUILD_opencv_java=OFF `
|
||||
-DBUILD_opencv_python2=OFF `
|
||||
-DBUILD_opencv_python3=OFF `
|
||||
-DBUILD_opencv_java_bindings_generator=OFF `
|
||||
-DBUILD_opencv_python_bindings_generator=OFF `
|
||||
-DBUILD_TIFF=OFF `
|
||||
-DCV_TRACE=OFF `
|
||||
-DWITH_OPENCL=OFF `
|
||||
-DHAVE_OPENCL=OFF `
|
||||
-DWITH_QT=OFF `
|
||||
-DWITH_GTK=OFF `
|
||||
-DWITH_QUIRC=OFF `
|
||||
-DWITH_JASPER=OFF `
|
||||
-DWITH_WEBP=OFF `
|
||||
-DWITH_PROTOBUF=OFF `
|
||||
-DBUILD_SHARED_LIBS=OFF `
|
||||
-DWITH_OPENEXR=OFF `
|
||||
-DWITH_TIFF=OFF `
|
||||
```
|
||||
|
||||
## Building
|
||||
You are required to build using Unicode:
|
||||
`cmake --build . -- /p:CharacterSet=Unicode`
|
@ -46,6 +46,13 @@ foreach(sample_filename ${cpp_samples})
|
||||
if(HAVE_OPENGL AND sample_filename MATCHES "detect_mser")
|
||||
target_compile_definitions(${tgt} PRIVATE HAVE_OPENGL)
|
||||
endif()
|
||||
if(sample_filename MATCHES "simd_")
|
||||
# disabled intentionally - demonstation purposes only
|
||||
#target_include_directories(${tgt} PRIVATE "${CMAKE_CURRENT_LIST_DIR}")
|
||||
#target_compile_definitions(${tgt} PRIVATE OPENCV_SIMD_CONFIG_HEADER=opencv_simd_config_custom.hpp)
|
||||
#target_compile_definitions(${tgt} PRIVATE OPENCV_SIMD_CONFIG_INCLUDE_DIR=1)
|
||||
#target_compile_options(${tgt} PRIVATE -mavx2)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
include("tutorial_code/calib3d/real_time_pose_estimation/CMakeLists.txt" OPTIONAL)
|
||||
|
49
samples/cpp/simd_basic.cpp
Normal file
49
samples/cpp/simd_basic.cpp
Normal file
@ -0,0 +1,49 @@
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/core/simd_intrinsics.hpp"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
int main(int /*argc*/, char** /*argv*/)
|
||||
{
|
||||
printf("================== macro dump ===================\n");
|
||||
#ifdef CV_SIMD
|
||||
printf("CV_SIMD is defined: " CVAUX_STR(CV_SIMD) "\n");
|
||||
#ifdef CV_SIMD_WIDTH
|
||||
printf("CV_SIMD_WIDTH is defined: " CVAUX_STR(CV_SIMD_WIDTH) "\n");
|
||||
#endif
|
||||
#ifdef CV_SIMD128
|
||||
printf("CV_SIMD128 is defined: " CVAUX_STR(CV_SIMD128) "\n");
|
||||
#endif
|
||||
#ifdef CV_SIMD256
|
||||
printf("CV_SIMD256 is defined: " CVAUX_STR(CV_SIMD256) "\n");
|
||||
#endif
|
||||
#ifdef CV_SIMD512
|
||||
printf("CV_SIMD512 is defined: " CVAUX_STR(CV_SIMD512) "\n");
|
||||
#endif
|
||||
#ifdef CV_SIMD_64F
|
||||
printf("CV_SIMD_64F is defined: " CVAUX_STR(CV_SIMD_64F) "\n");
|
||||
#endif
|
||||
#ifdef CV_SIMD_FP16
|
||||
printf("CV_SIMD_FP16 is defined: " CVAUX_STR(CV_SIMD_FP16) "\n");
|
||||
#endif
|
||||
#else
|
||||
printf("CV_SIMD is NOT defined\n");
|
||||
#endif
|
||||
|
||||
#ifdef CV_SIMD
|
||||
printf("================= sizeof checks =================\n");
|
||||
printf("sizeof(v_uint8) = %d\n", (int)sizeof(v_uint8));
|
||||
printf("sizeof(v_int32) = %d\n", (int)sizeof(v_int32));
|
||||
printf("sizeof(v_float32) = %d\n", (int)sizeof(v_float32));
|
||||
|
||||
printf("================== arithm check =================\n");
|
||||
v_uint8 a = vx_setall_u8(10);
|
||||
v_uint8 c = a + vx_setall_u8(45);
|
||||
printf("(vx_setall_u8(10) + vx_setall_u8(45)).get0() => %d\n", (int)c.get0());
|
||||
#else
|
||||
printf("\nSIMD intrinsics are not available. Check compilation target and passed build options.\n");
|
||||
#endif
|
||||
|
||||
printf("===================== done ======================\n");
|
||||
return 0;
|
||||
}
|
@ -892,7 +892,7 @@ layer {
|
||||
}
|
||||
convolution_param {
|
||||
num_output: 128
|
||||
pad: 1
|
||||
pad: 0
|
||||
kernel_size: 3
|
||||
stride: 1
|
||||
weight_filler {
|
||||
@ -958,7 +958,7 @@ layer {
|
||||
}
|
||||
convolution_param {
|
||||
num_output: 128
|
||||
pad: 1
|
||||
pad: 0
|
||||
kernel_size: 3
|
||||
stride: 1
|
||||
weight_filler {
|
||||
|
1790
samples/dnn/face_detector/deploy_lowres.prototxt
Normal file
1790
samples/dnn/face_detector/deploy_lowres.prototxt
Normal file
File diff suppressed because it is too large
Load Diff
@ -69,7 +69,7 @@ function recognize(face) {
|
||||
|
||||
function loadModels(callback) {
|
||||
var utils = new Utils('');
|
||||
var proto = 'https://raw.githubusercontent.com/opencv/opencv/master/samples/dnn/face_detector/deploy.prototxt';
|
||||
var proto = 'https://raw.githubusercontent.com/opencv/opencv/master/samples/dnn/face_detector/deploy_lowres.prototxt';
|
||||
var weights = 'https://raw.githubusercontent.com/opencv/opencv_3rdparty/dnn_samples_face_detector_20180205_fp16/res10_300x300_ssd_iter_140000_fp16.caffemodel';
|
||||
var recognModel = 'https://raw.githubusercontent.com/pyannote/pyannote-data/master/openface.nn4.small2.v1.t7';
|
||||
utils.createFileFromUrl('face_detector.prototxt', proto, () => {
|
||||
|
Loading…
Reference in New Issue
Block a user