Commit 33dde339 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge remote-tracking branch 'upstream/3.4' into merge-3.4

parents 066c074b 341e2fa7
...@@ -903,19 +903,19 @@ public: ...@@ -903,19 +903,19 @@ public:
// given in src. This function is a port of the EigenvalueSolver in JAMA, // given in src. This function is a port of the EigenvalueSolver in JAMA,
// which has been released to public domain by The MathWorks and the // which has been released to public domain by The MathWorks and the
// National Institute of Standards and Technology (NIST). // National Institute of Standards and Technology (NIST).
EigenvalueDecomposition(InputArray src, bool fallbackSymmetric = true) : EigenvalueDecomposition() :
n(0), n(0),
d(NULL), e(NULL), ort(NULL), d(NULL), e(NULL), ort(NULL),
V(NULL), H(NULL) V(NULL), H(NULL)
{ {
compute(src, fallbackSymmetric); // nothing
} }
// This function computes the Eigenvalue Decomposition for a general matrix // This function computes the Eigenvalue Decomposition for a general matrix
// given in src. This function is a port of the EigenvalueSolver in JAMA, // given in src. This function is a port of the EigenvalueSolver in JAMA,
// which has been released to public domain by The MathWorks and the // which has been released to public domain by The MathWorks and the
// National Institute of Standards and Technology (NIST). // National Institute of Standards and Technology (NIST).
void compute(InputArray src, bool fallbackSymmetric) void compute(InputArray src, bool fallbackSymmetric = true)
{ {
CV_INSTRUMENT_REGION(); CV_INSTRUMENT_REGION();
...@@ -970,7 +970,8 @@ void eigenNonSymmetric(InputArray _src, OutputArray _evals, OutputArray _evects) ...@@ -970,7 +970,8 @@ void eigenNonSymmetric(InputArray _src, OutputArray _evals, OutputArray _evects)
else else
src64f = src; src64f = src;
EigenvalueDecomposition eigensystem(src64f, false); EigenvalueDecomposition eigensystem;
eigensystem.compute(src64f, false);
// EigenvalueDecomposition returns transposed and non-sorted eigenvalues // EigenvalueDecomposition returns transposed and non-sorted eigenvalues
std::vector<double> eigenvalues64f; std::vector<double> eigenvalues64f;
...@@ -1146,7 +1147,8 @@ void LDA::lda(InputArrayOfArrays _src, InputArray _lbls) { ...@@ -1146,7 +1147,8 @@ void LDA::lda(InputArrayOfArrays _src, InputArray _lbls) {
// M = inv(Sw)*Sb // M = inv(Sw)*Sb
Mat M; Mat M;
gemm(Swi, Sb, 1.0, Mat(), 0.0, M); gemm(Swi, Sb, 1.0, Mat(), 0.0, M);
EigenvalueDecomposition es(M); EigenvalueDecomposition es;
es.compute(M);
_eigenvalues = es.eigenvalues(); _eigenvalues = es.eigenvalues();
_eigenvectors = es.eigenvectors(); _eigenvectors = es.eigenvectors();
// reshape eigenvalues, so they are stored by column // reshape eigenvalues, so they are stored by column
......
...@@ -94,7 +94,7 @@ void* allocSingletonBuffer(size_t size) { return fastMalloc(size); } ...@@ -94,7 +94,7 @@ void* allocSingletonBuffer(size_t size) { return fastMalloc(size); }
#include <cstdlib> // std::abort #include <cstdlib> // std::abort
#endif #endif
#if defined __ANDROID__ || defined __linux__ || defined __FreeBSD__ || defined __HAIKU__ || defined __Fuchsia__ #if defined __ANDROID__ || defined __linux__ || defined __FreeBSD__ || defined __OpenBSD__ || defined __HAIKU__ || defined __Fuchsia__
# include <unistd.h> # include <unistd.h>
# include <fcntl.h> # include <fcntl.h>
# include <elf.h> # include <elf.h>
......
...@@ -94,7 +94,7 @@ set(perf_path "${CMAKE_CURRENT_LIST_DIR}/perf") ...@@ -94,7 +94,7 @@ set(perf_path "${CMAKE_CURRENT_LIST_DIR}/perf")
file(GLOB_RECURSE perf_srcs "${perf_path}/*.cpp") file(GLOB_RECURSE perf_srcs "${perf_path}/*.cpp")
file(GLOB_RECURSE perf_hdrs "${perf_path}/*.hpp" "${perf_path}/*.h") file(GLOB_RECURSE perf_hdrs "${perf_path}/*.hpp" "${perf_path}/*.h")
ocv_add_perf_tests(${INF_ENGINE_TARGET} ocv_add_perf_tests(${INF_ENGINE_TARGET}
FILES test_common "${CMAKE_CURRENT_LIST_DIR}/test/test_common.cpp" FILES test_common "${CMAKE_CURRENT_LIST_DIR}/test/test_common.hpp" "${CMAKE_CURRENT_LIST_DIR}/test/test_common.impl.hpp"
FILES Src ${perf_srcs} FILES Src ${perf_srcs}
FILES Include ${perf_hdrs} FILES Include ${perf_hdrs}
) )
......
// 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.
#include "perf_precomp.hpp"
#include "../test/test_common.impl.hpp" // shared with accuracy tests
This diff is collapsed.
This diff is collapsed.
...@@ -177,34 +177,17 @@ TEST_P(DNNTestOpenVINO, models) ...@@ -177,34 +177,17 @@ TEST_P(DNNTestOpenVINO, models)
{ {
Target target = (dnn::Target)(int)get<0>(GetParam()); Target target = (dnn::Target)(int)get<0>(GetParam());
std::string modelName = get<1>(GetParam()); std::string modelName = get<1>(GetParam());
std::string precision = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD) ? "FP16" : "FP32";
#ifdef INF_ENGINE_RELEASE #ifdef INF_ENGINE_RELEASE
#if INF_ENGINE_RELEASE <= 2018030000 #if INF_ENGINE_RELEASE <= 2018050000
if (target == DNN_TARGET_MYRIAD && (modelName == "landmarks-regression-retail-0001" ||
modelName == "semantic-segmentation-adas-0001" ||
modelName == "face-reidentification-retail-0001"))
throw SkipTestException("");
#elif INF_ENGINE_RELEASE == 2018040000
if (modelName == "single-image-super-resolution-0034" ||
(target == DNN_TARGET_MYRIAD && (modelName == "license-plate-recognition-barrier-0001" ||
modelName == "landmarks-regression-retail-0009" ||
modelName == "semantic-segmentation-adas-0001")))
throw SkipTestException("");
#elif INF_ENGINE_RELEASE == 2018050000
if (modelName == "single-image-super-resolution-0063" ||
modelName == "single-image-super-resolution-1011" ||
modelName == "single-image-super-resolution-1021" ||
(target == DNN_TARGET_OPENCL_FP16 && modelName == "face-reidentification-retail-0095") ||
(target == DNN_TARGET_MYRIAD && (modelName == "license-plate-recognition-barrier-0001" ||
modelName == "semantic-segmentation-adas-0001")))
throw SkipTestException("");
#endif
#endif
std::string precision = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD) ? "FP16" : "FP32";
std::string prefix = utils::fs::join("intel_models", std::string prefix = utils::fs::join("intel_models",
utils::fs::join(modelName, utils::fs::join(modelName,
utils::fs::join(precision, modelName))); utils::fs::join(precision, modelName)));
#endif
#endif
initDLDTDataPath();
std::string xmlPath = findDataFile(prefix + ".xml"); std::string xmlPath = findDataFile(prefix + ".xml");
std::string binPath = findDataFile(prefix + ".bin"); std::string binPath = findDataFile(prefix + ".bin");
...@@ -221,49 +204,21 @@ TEST_P(DNNTestOpenVINO, models) ...@@ -221,49 +204,21 @@ TEST_P(DNNTestOpenVINO, models)
{ {
auto dstIt = cvOutputsMap.find(srcIt.first); auto dstIt = cvOutputsMap.find(srcIt.first);
CV_Assert(dstIt != cvOutputsMap.end()); CV_Assert(dstIt != cvOutputsMap.end());
double normInfIE = cvtest::norm(srcIt.second, cv::NORM_INF);
double normInf = cvtest::norm(srcIt.second, dstIt->second, cv::NORM_INF); double normInf = cvtest::norm(srcIt.second, dstIt->second, cv::NORM_INF);
double eps = 0; EXPECT_EQ(normInf, 0);
if (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD)
{
double fp16_eps = 1.0/1024;
eps = fp16_eps * 1/*ULP*/ * std::max(normInfIE, 1.0);
}
EXPECT_LE(normInf, eps) << "IE: " << normInfIE;
}
}
static testing::internal::ParamGenerator<String> intelModels()
{
initDLDTDataPath();
std::vector<String> modelsNames;
std::string path;
try
{
path = findDataDirectory("intel_models", false);
}
catch (...)
{
std::cerr << "ERROR: Can't find OpenVINO models. Check INTEL_CVSDK_DIR environment variable (run setup.sh)" << std::endl;
return ValuesIn(modelsNames); // empty list
} }
cv::utils::fs::glob_relative(path, "", modelsNames, false, true);
modelsNames.erase(
std::remove_if(modelsNames.begin(), modelsNames.end(),
[&](const String& dir){ return !utils::fs::isDirectory(utils::fs::join(path, dir)); }),
modelsNames.end()
);
CV_Assert(!modelsNames.empty());
return ValuesIn(modelsNames);
} }
INSTANTIATE_TEST_CASE_P(/**/, INSTANTIATE_TEST_CASE_P(/**/,
DNNTestOpenVINO, DNNTestOpenVINO,
Combine(testing::ValuesIn(getAvailableTargets(DNN_BACKEND_INFERENCE_ENGINE)), intelModels()) Combine(testing::ValuesIn(getAvailableTargets(DNN_BACKEND_INFERENCE_ENGINE)),
testing::Values(
"age-gender-recognition-retail-0013",
"face-person-detection-retail-0002",
"head-pose-estimation-adas-0001",
"person-detection-retail-0002",
"vehicle-detection-adas-0002"
))
); );
}} }}
......
...@@ -175,8 +175,11 @@ void RBaseStream::setPos( int pos ) ...@@ -175,8 +175,11 @@ void RBaseStream::setPos( int pos )
} }
int offset = pos % m_block_size; int offset = pos % m_block_size;
int old_block_pos = m_block_pos;
m_block_pos = pos - offset; m_block_pos = pos - offset;
m_current = m_start + offset; m_current = m_start + offset;
if (old_block_pos != m_block_pos)
readBlock();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment