From 8af5680e56a78ed89619acdf498c8ed2188eaafd Mon Sep 17 00:00:00 2001 From: David OK Date: Thu, 14 Dec 2023 15:42:10 +0000 Subject: [PATCH] MAINT: disable code coverage for now. Strange error. --- .../DO/Sara/Visualization/Features/Draw.cpp | 24 +++++++++++-------- .../oddkiva/sara/pybind11/test/CMakeLists.txt | 6 ++--- .../v4/test/test_yolov4_config_parsing.py | 3 ++- requirements.txt | 12 ++++++---- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/cpp/src/DO/Sara/Visualization/Features/Draw.cpp b/cpp/src/DO/Sara/Visualization/Features/Draw.cpp index 441e6f2d3..cf688e416 100644 --- a/cpp/src/DO/Sara/Visualization/Features/Draw.cpp +++ b/cpp/src/DO/Sara/Visualization/Features/Draw.cpp @@ -16,7 +16,7 @@ using namespace std; -namespace DO { namespace Sara { +namespace DO::Sara { auto draw(const OERegion& f, const Rgb8& color, float scale, const Point2f& offset) -> void @@ -37,16 +37,18 @@ namespace DO { namespace Sara { // In slides: // http://www.cs.unc.edu/~lazebnik/spring11/lec08_blob.pdf // the blob radius is the scale multiplied sqrt(2). - constexpr auto sqrt_two = static_cast(M_SQRT2); + static constexpr auto sqrt_two = static_cast(M_SQRT2); const auto a = radii(0) * sqrt_two; const auto b = radii(1) * sqrt_two; // Orientation. - const auto ori_degree = atan2(U(1, 0), U(0, 0)) * // - 180 / static_cast(M_PI); + const auto& ox = U(0, 0); + const auto& oy = U(1, 0); + static constexpr auto radian_32f = static_cast(180 / M_PI); + const auto ori_degree = std::atan2(oy, ox) * radian_32f; // Start and end points of orientation line. - const Matrix2f& L = f.affinity().block(0, 0, 2, 2); + const Matrix2f& L = f.affinity().topLeftCorner<2, 2>(); const Vector2f& p1 = z * (f.center() + offset); const Vector2f& p2 = p1 + z * sqrt_two * L * Vector2f::UnitX(); @@ -99,16 +101,18 @@ namespace DO { namespace Sara { // In slides: // http://www.cs.unc.edu/~lazebnik/spring11/lec08_blob.pdf // the blob radius is the scale multiplied sqrt(2). - constexpr auto sqrt_two = static_cast(M_SQRT2); + static constexpr auto sqrt_two = static_cast(M_SQRT2); const auto a = radii(0) * sqrt_two; const auto b = radii(1) * sqrt_two; // Orientation. - const auto ori_degree = atan2(U(1, 0), U(0, 0)) * // - 180 / static_cast(M_PI); + const auto& ox = U(0, 0); + const auto& oy = U(1, 0); + static constexpr auto radian_32f = static_cast(180 / M_PI); + const auto ori_degree = std::atan2(oy, ox) * radian_32f; // Start and end points of orientation line. - const Matrix2f& L = f.affinity().block(0, 0, 2, 2); + const Matrix2f& L = f.affinity().topLeftCorner<2, 2>(); const Vector2f& p1 = z * (f.center() + offset); const Vector2f& p2 = p1 + z * sqrt_two * L * Vector2f::UnitX(); @@ -142,4 +146,4 @@ namespace DO { namespace Sara { } } -}} // namespace DO::Sara +} // namespace DO::Sara diff --git a/python/oddkiva/sara/pybind11/test/CMakeLists.txt b/python/oddkiva/sara/pybind11/test/CMakeLists.txt index 953610d1c..80c947494 100644 --- a/python/oddkiva/sara/pybind11/test/CMakeLists.txt +++ b/python/oddkiva/sara/pybind11/test/CMakeLists.txt @@ -5,9 +5,9 @@ add_custom_target(pytest COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=$ coverage run -m pytest -s - COMMAND ${CMAKE_COMMAND} - -E env PYTHONPATH=$ - coverage report + # COMMAND ${CMAKE_COMMAND} + # -E env PYTHONPATH=$ + # coverage report WORKING_DIRECTORY ${DO_Sara_DIR}/python COMMENT "Running Python tests.") set_target_properties(pytest PROPERTIES FOLDER "Python") diff --git a/python/oddkiva/shakti/inference/yolo/v4/test/test_yolov4_config_parsing.py b/python/oddkiva/shakti/inference/yolo/v4/test/test_yolov4_config_parsing.py index 08b25bc8e..16507861b 100644 --- a/python/oddkiva/shakti/inference/yolo/v4/test/test_yolov4_config_parsing.py +++ b/python/oddkiva/shakti/inference/yolo/v4/test/test_yolov4_config_parsing.py @@ -7,7 +7,8 @@ ) -SARA_SOURCE_DIR_PATH = Path('/Users/oddkiva/GitLab/oddkiva/sara') +THIS_FILE = str(__file__) +SARA_SOURCE_DIR_PATH = Path(THIS_FILE[:THIS_FILE.find('sara') + len('sara')]) SARA_DATA_DIR_PATH = SARA_SOURCE_DIR_PATH / 'data' YOLO_V4_TINY_DIR_PATH = SARA_DATA_DIR_PATH / 'trained_models' diff --git a/requirements.txt b/requirements.txt index a27b35dc6..28880283d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,11 @@ -coverage==4.5.4 +pybind11 +pytest +coverage + +ipython ipdb ipdbplugin -nose + numpy -PySide2 scipy -ipython -pybind11 +PySide2