From 2aac0a5a26fa8f63cba8f23d01690791006fa7fb Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sun, 15 May 2022 09:35:38 +0000 Subject: [PATCH 1/6] GHA: fix git merge --- .github/workflows/PR-3.4-W10.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PR-3.4-W10.yaml b/.github/workflows/PR-3.4-W10.yaml index 528cd596d9..b8068cd05f 100644 --- a/.github/workflows/PR-3.4-W10.yaml +++ b/.github/workflows/PR-3.4-W10.yaml @@ -44,7 +44,7 @@ jobs: OPENCV_EXTRA_FORK=$(git ls-remote --heads "git@github.com:/${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}") || true if [[ ! -z "$OPENCV_EXTRA_FORK" ]]; then echo "Merge opencv_extra with ${{ env.SOURCE_BRANCH_NAME }} branch" - cd opencv_extra + cd ${{ github.workspace }}\opencv_extra git config user.email "opencv.ci" git config user.name "opencv.ci" git pull -v "git@github.com:${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}" @@ -159,7 +159,7 @@ jobs: OPENCV_CONTRIB_FORK=$(git ls-remote --heads "git@github.com:${{ env.PR_AUTHOR }}/opencv_contrib" "${{ env.SOURCE_BRANCH_NAME }}") || true if [[ ! -z "$OPENCV_CONTRIB_FORK" ]]; then echo "Merge opencv_contrib with ${{ env.SOURCE_BRANCH_NAME }} branch" - cd /opencv_contrib + cd ${{ github.workspace }}\opencv_contrib git config user.email "opencv.ci" git config user.name "opencv.ci" git pull -v "git@github.com:${{ env.PR_AUTHOR }}/opencv_contrib" "${{ env.SOURCE_BRANCH_NAME }}" From 89f8d4ae1235df19f49ba3167f0e4f2b4acc5c0a Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sun, 15 May 2022 16:20:45 +0000 Subject: [PATCH 2/6] build: GCC12 warnings --- 3rdparty/libpng/CMakeLists.txt | 4 +++- 3rdparty/libtiff/CMakeLists.txt | 3 ++- apps/traincascade/cascadeclassifier.cpp | 2 +- modules/ts/src/ts_gtest.cpp | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/3rdparty/libpng/CMakeLists.txt b/3rdparty/libpng/CMakeLists.txt index efa59627eb..f72b966079 100644 --- a/3rdparty/libpng/CMakeLists.txt +++ b/3rdparty/libpng/CMakeLists.txt @@ -77,7 +77,9 @@ endif(MSVC) add_library(${PNG_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${lib_srcs} ${lib_hdrs}) target_link_libraries(${PNG_LIBRARY} ${ZLIB_LIBRARIES}) -ocv_warnings_disable(CMAKE_C_FLAGS -Wundef -Wcast-align -Wimplicit-fallthrough -Wunused-parameter -Wsign-compare) +ocv_warnings_disable(CMAKE_C_FLAGS -Wundef -Wcast-align -Wimplicit-fallthrough -Wunused-parameter -Wsign-compare + -Wmaybe-uninitialized +) set_target_properties(${PNG_LIBRARY} PROPERTIES OUTPUT_NAME ${PNG_LIBRARY} diff --git a/3rdparty/libtiff/CMakeLists.txt b/3rdparty/libtiff/CMakeLists.txt index 2074888a52..99c1933d22 100644 --- a/3rdparty/libtiff/CMakeLists.txt +++ b/3rdparty/libtiff/CMakeLists.txt @@ -452,8 +452,9 @@ ocv_warnings_disable(CMAKE_C_FLAGS -Wno-unused-but-set-variable -Wmissing-protot -Wcast-align -Wshadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wmisleading-indentation -Wimplicit-fallthrough + -Wunused-parameter # clang + -Warray-parameter ) -ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang ocv_warnings_disable(CMAKE_CXX_FLAGS -Wmissing-declarations -Wunused-parameter -Wmissing-prototypes -Wundef # tiffiop.h: #if __clang_major__ >= 4 ) diff --git a/apps/traincascade/cascadeclassifier.cpp b/apps/traincascade/cascadeclassifier.cpp index 3d7b383258..5a83746bc4 100644 --- a/apps/traincascade/cascadeclassifier.cpp +++ b/apps/traincascade/cascadeclassifier.cpp @@ -252,7 +252,7 @@ bool CvCascadeClassifier::train( const string _cascadeDirName, fs << "}"; } // save current stage - char buf[10]; + char buf[32]; sprintf(buf, "%s%d", "stage", i ); string stageFilename = dirName + buf + ".xml"; FileStorage fs( stageFilename, FileStorage::WRITE ); diff --git a/modules/ts/src/ts_gtest.cpp b/modules/ts/src/ts_gtest.cpp index a65ef721a2..030c56bb4f 100644 --- a/modules/ts/src/ts_gtest.cpp +++ b/modules/ts/src/ts_gtest.cpp @@ -8716,7 +8716,7 @@ static void StackLowerThanAddress(const void* ptr, bool* result) { // Make sure AddressSanitizer does not tamper with the stack here. GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ static bool StackGrowsDown() { - int dummy; + int dummy = 0; bool result; StackLowerThanAddress(&dummy, &result); return result; From ce859edba81a97f344a15b13c42c3331ab36df75 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Tue, 17 May 2022 14:53:04 +0000 Subject: [PATCH 3/6] GHA: fix git merge (part 2) --- .github/workflows/PR-3.4-W10.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PR-3.4-W10.yaml b/.github/workflows/PR-3.4-W10.yaml index b8068cd05f..3bbd6a543b 100644 --- a/.github/workflows/PR-3.4-W10.yaml +++ b/.github/workflows/PR-3.4-W10.yaml @@ -44,7 +44,7 @@ jobs: OPENCV_EXTRA_FORK=$(git ls-remote --heads "git@github.com:/${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}") || true if [[ ! -z "$OPENCV_EXTRA_FORK" ]]; then echo "Merge opencv_extra with ${{ env.SOURCE_BRANCH_NAME }} branch" - cd ${{ github.workspace }}\opencv_extra + cd opencv_extra git config user.email "opencv.ci" git config user.name "opencv.ci" git pull -v "git@github.com:${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}" @@ -159,7 +159,7 @@ jobs: OPENCV_CONTRIB_FORK=$(git ls-remote --heads "git@github.com:${{ env.PR_AUTHOR }}/opencv_contrib" "${{ env.SOURCE_BRANCH_NAME }}") || true if [[ ! -z "$OPENCV_CONTRIB_FORK" ]]; then echo "Merge opencv_contrib with ${{ env.SOURCE_BRANCH_NAME }} branch" - cd ${{ github.workspace }}\opencv_contrib + cd opencv_contrib git config user.email "opencv.ci" git config user.name "opencv.ci" git pull -v "git@github.com:${{ env.PR_AUTHOR }}/opencv_contrib" "${{ env.SOURCE_BRANCH_NAME }}" From 7be8a71c608d3d09473a4c13bea67833c81b2297 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Tue, 17 May 2022 19:23:32 +0300 Subject: [PATCH 4/6] Merge pull request #21994 from asenyaev:asen/extra_dnn_testing Extended DNN testing in GHA * Extended DNN testing in GHA for 3.4 branch * Updated docker images in Linux GitHub Actions * Added OPENCV_DOWNLOAD_PATH flag for ARM build to use pre-downloaded binaries --- .github/workflows/PR-3.4-ARM64.yaml | 56 +++++++++++++++++++---------- .github/workflows/PR-3.4-U20.yaml | 32 +++++++++++++---- .github/workflows/PR-3.4-W10.yaml | 2 ++ 3 files changed, 66 insertions(+), 24 deletions(-) diff --git a/.github/workflows/PR-3.4-ARM64.yaml b/.github/workflows/PR-3.4-ARM64.yaml index affb2cb9ec..9d8a1037bd 100644 --- a/.github/workflows/PR-3.4-ARM64.yaml +++ b/.github/workflows/PR-3.4-ARM64.yaml @@ -6,15 +6,17 @@ on: - 3.4 env: - EXTRA_CMAKE_OPTIONS: '-DBUILD_DOCS=ON -DPYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3 -DBUILD_opencv_xfeatures2d=OFF -DBUILD_EXAMPLES=ON -DOPENCV_ENABLE_NONFREE=ON -DENABLE_CCACHE=OFF' - OPENCV_TEST_DATA_PATH: '/opencv_extra/testdata' - OPENCV_DOCKER_WORKDIR: '/__w/opencv/opencv' + EXTRA_CMAKE_OPTIONS: '-DBUILD_DOCS=ON -DPYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3 -DOPENCV_DOWNLOAD_PATH=/home/ci/binaries_cache -DBUILD_opencv_xfeatures2d=OFF -DBUILD_EXAMPLES=ON -DOPENCV_ENABLE_NONFREE=ON' PR_AUTHOR: ${{ github.event.pull_request.user.login }} PR_AUTHOR_FORK: ${{ github.event.pull_request.head.repo.full_name }} SOURCE_BRANCH_NAME: ${{ github.head_ref }} TARGET_BRANCH_NAME: ${{ github.base_ref }} ANT_HOME: '/usr/share/ant' + GIT_CACHE_DOCKER: '/home/ci/git_cache' PYTHONPATH: /opencv-build/python_loader:$PYTHONPATH + OPENCV_TEST_DATA_PATH: '/opencv_extra/testdata' + OPENCV_DOCKER_WORKDIR: '/opencv' + DNN_MODELS: '/home/ci/dnn-models' jobs: BuildAndTest: @@ -23,7 +25,12 @@ jobs: run: shell: bash container: - image: docker.io/yuentau/ocv_ubuntu:20.04-arm64 + image: quay.io/opencv-ci/opencv-ubuntu:20.04-arm64 + volumes: + - /home/opencv-cn/git_cache:/home/ci/git_cache + - /home/opencv-cn/ci_cache/opencv:/home/ci/.ccache + - /home/opencv-cn/binaries_cache:/home/ci/binaries_cache + - /home/opencv-cn/dnn-models:/home/ci/dnn-models steps: - name: PR info run: | @@ -32,13 +39,9 @@ jobs: echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}" echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}" - name: Clean - run: find . -mindepth 1 -delete + run: find ${{ env.OPENCV_DOCKER_WORKDIR }} -mindepth 1 -delete - name: Fetch opencv - uses: actions/checkout@v3 - with: - repository: opencv/opencv - ref: ${{ env.TARGET_BRANCH_NAME }} - fetch-depth: 0 + run: git clone --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv.git https://github.com/opencv/opencv.git ${{ env.OPENCV_DOCKER_WORKDIR }} - name: Merge opencv with ${{ env.SOURCE_BRANCH_NAME }} branch run: | cd ${{ env.OPENCV_DOCKER_WORKDIR }} @@ -47,7 +50,7 @@ jobs: git config user.name "opencv.ci" git pull -v "https://github.com/${{ env.PR_AUTHOR_FORK }}" "${{ env.SOURCE_BRANCH_NAME }}" - name: Clone opencv_extra - run: git clone --single-branch --branch ${{ env.TARGET_BRANCH_NAME }} https://github.com/opencv/opencv_extra.git /opencv_extra + run: git clone --single-branch --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv_extra.git https://github.com/opencv/opencv_extra.git /opencv_extra - name: Merge opencv_extra with ${{ env.SOURCE_BRANCH_NAME }} branch run: | OPENCV_EXTRA_FORK=$(git ls-remote --heads "https://github.com/${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}") || true @@ -60,6 +63,22 @@ jobs: else echo "No merge since ${{ env.PR_AUTHOR }}/opencv_extra does not have branch ${{ env.SOURCE_BRANCH_NAME }}" fi + - name: Extra DNN models update + run: | + DOWNLOAD_MODELS_FILE='download_models.py' + LATEST_SAVED_HASH=$(cat ${{ env.DNN_MODELS }}/dnn/latest-hash-${{ env.TARGET_BRANCH_NAME }}.txt) + LATEST_HASH=$(sha256sum /opencv_extra/testdata/dnn/$DOWNLOAD_MODELS_FILE | awk '{print $1}') + if [[ $LATEST_HASH == $LATEST_SAVED_HASH ]]; then + echo "DNN models are up to date" + echo "OPENCV_DNN_TEST_DATA_PATH=${{ env.DNN_MODELS }}" >> $GITHUB_ENV + else + echo "Updating DNN models list" + echo "OPENCV_DNN_TEST_DATA_PATH=/home/ci/new-dnn-models" >> $GITHUB_ENV && OPENCV_DNN_TEST_DATA_PATH='/home/ci/new-dnn-models' + mkdir -p "$OPENCV_DNN_TEST_DATA_PATH" + rsync -a --exclude=$DOWNLOAD_MODELS_FILE ${{ env.DNN_MODELS }}/* $OPENCV_DNN_TEST_DATA_PATH + cp /opencv_extra/testdata/dnn/download_models.py $OPENCV_DNN_TEST_DATA_PATH/dnn + cd $OPENCV_DNN_TEST_DATA_PATH/dnn && python3 download_models.py + fi - name: Configure OpenCV run: | cmake -G Ninja -B /opencv-build ${{ env.EXTRA_CMAKE_OPTIONS }} ${{ env.OPENCV_DOCKER_WORKDIR }} @@ -144,21 +163,22 @@ jobs: run: shell: bash container: - image: docker.io/yuentau/ocv_ubuntu:20.04-arm64 + image: quay.io/opencv-ci/opencv-ubuntu:20.04-arm64 + volumes: + - /home/opencv-cn/git_cache:/home/ci/git_cache + - /home/opencv-cn/ci_cache/opencv:/home/ci/.ccache + - /home/opencv-cn/binaries_cache:/home/ci/binaries_cache steps: - name: PR info run: | echo "PR Author: ${{ env.PR_AUTHOR }}" + echo "PR Author fork: ${{ env.PR_AUTHOR_FORK }}" echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}" echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}" - name: Clean - run: find . -mindepth 1 -delete + run: find ${{ env.OPENCV_DOCKER_WORKDIR }} -mindepth 1 -delete - name: Fetch opencv - uses: actions/checkout@v3 - with: - repository: opencv/opencv - ref: ${{ env.TARGET_BRANCH_NAME }} - fetch-depth: 0 + run: git clone --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv.git https://github.com/opencv/opencv.git ${{ env.OPENCV_DOCKER_WORKDIR }} - name: Merge opencv with a test branch run: | cd ${{ env.OPENCV_DOCKER_WORKDIR }} diff --git a/.github/workflows/PR-3.4-U20.yaml b/.github/workflows/PR-3.4-U20.yaml index e400962379..268d9dae8c 100644 --- a/.github/workflows/PR-3.4-U20.yaml +++ b/.github/workflows/PR-3.4-U20.yaml @@ -11,11 +11,12 @@ env: PR_AUTHOR_FORK: ${{ github.event.pull_request.head.repo.full_name }} SOURCE_BRANCH_NAME: ${{ github.head_ref }} TARGET_BRANCH_NAME: ${{ github.base_ref }} - ANT_HOME: /usr/share/ant - GIT_CACHE_DOCKER: /home/ci/git_cache + ANT_HOME: '/usr/share/ant' + GIT_CACHE_DOCKER: '/home/ci/git_cache' PYTHONPATH: /opencv-build/python_loader:$PYTHONPATH - OPENCV_TEST_DATA_PATH: /opencv_extra/testdata - OPENCV_DOCKER_WORKDIR: /opencv + OPENCV_TEST_DATA_PATH: '/opencv_extra/testdata' + OPENCV_DOCKER_WORKDIR: '/opencv' + DNN_MODELS: '/home/ci/dnn-models' jobs: BuildAndTest: @@ -24,15 +25,17 @@ jobs: run: shell: bash container: - image: quay.io/asenyaev/opencv-ubuntu:20.04 + image: quay.io/opencv-ci/opencv-ubuntu:20.04 volumes: - /home/opencv-cn/git_cache:/home/ci/git_cache - /home/opencv-cn/ci_cache/opencv:/home/ci/.ccache - /home/opencv-cn/binaries_cache:/home/ci/binaries_cache + - /home/opencv-cn/dnn-models:/home/ci/dnn-models steps: - name: PR info run: | echo "PR Author: ${{ env.PR_AUTHOR }}" + echo "PR Author fork: ${{ env.PR_AUTHOR_FORK }}" echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}" echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}" - name: Clean @@ -60,6 +63,22 @@ jobs: else echo "No merge since ${{ env.PR_AUTHOR }}/opencv_extra does not have branch ${{ env.SOURCE_BRANCH_NAME }}" fi + - name: Extra DNN models update + run: | + DOWNLOAD_MODELS_FILE='download_models.py' + LATEST_SAVED_HASH=$(cat ${{ env.DNN_MODELS }}/dnn/latest-hash-${{ env.TARGET_BRANCH_NAME }}.txt) + LATEST_HASH=$(sha256sum /opencv_extra/testdata/dnn/$DOWNLOAD_MODELS_FILE | awk '{print $1}') + if [[ $LATEST_HASH == $LATEST_SAVED_HASH ]]; then + echo "DNN models are up to date" + echo "OPENCV_DNN_TEST_DATA_PATH=${{ env.DNN_MODELS }}" >> $GITHUB_ENV + else + echo "Updating DNN models list" + echo "OPENCV_DNN_TEST_DATA_PATH=/home/ci/new-dnn-models" >> $GITHUB_ENV && OPENCV_DNN_TEST_DATA_PATH='/home/ci/new-dnn-models' + mkdir -p "$OPENCV_DNN_TEST_DATA_PATH" + rsync -a --exclude=$DOWNLOAD_MODELS_FILE ${{ env.DNN_MODELS }}/* $OPENCV_DNN_TEST_DATA_PATH + cp /opencv_extra/testdata/dnn/download_models.py $OPENCV_DNN_TEST_DATA_PATH/dnn + cd $OPENCV_DNN_TEST_DATA_PATH/dnn && python3 download_models.py + fi - name: Configure OpenCV run: | cd /opencv-build @@ -147,7 +166,7 @@ jobs: run: shell: bash container: - image: quay.io/asenyaev/opencv-ubuntu:20.04 + image: quay.io/opencv-ci/opencv-ubuntu:20.04 volumes: - /home/opencv-cn/git_cache:/home/ci/git_cache - /home/opencv-cn/ci_cache/opencv:/home/ci/.ccache @@ -156,6 +175,7 @@ jobs: - name: PR info run: | echo "PR Author: ${{ env.PR_AUTHOR }}" + echo "PR Author fork: ${{ env.PR_AUTHOR_FORK }}" echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}" echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}" - name: Clean diff --git a/.github/workflows/PR-3.4-W10.yaml b/.github/workflows/PR-3.4-W10.yaml index b8068cd05f..2323b2df79 100644 --- a/.github/workflows/PR-3.4-W10.yaml +++ b/.github/workflows/PR-3.4-W10.yaml @@ -24,6 +24,7 @@ jobs: - name: PR info run: | echo "PR Author: ${{ env.PR_AUTHOR }}" + echo "PR Author fork: ${{ env.PR_AUTHOR_FORK }}" echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}" echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}" - name: Clean @@ -139,6 +140,7 @@ jobs: - name: PR info run: | echo "PR Author: ${{ env.PR_AUTHOR }}" + echo "PR Author fork: ${{ env.PR_AUTHOR_FORK }}" echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}" echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}" - name: Clean From aaf7f5ae02468795e46b1dd90ad6caf64bbb968f Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 20 May 2022 14:29:43 +0300 Subject: [PATCH 5/6] Move workflows to a dedicated repository --- .github/workflows/PR-3.4-ARM64.yaml | 209 --------------------------- .github/workflows/PR-3.4-U20.yaml | 213 ---------------------------- .github/workflows/PR-3.4-W10.yaml | 180 ----------------------- .github/workflows/PR-3.4.yaml | 16 +++ 4 files changed, 16 insertions(+), 602 deletions(-) delete mode 100644 .github/workflows/PR-3.4-ARM64.yaml delete mode 100644 .github/workflows/PR-3.4-U20.yaml delete mode 100644 .github/workflows/PR-3.4-W10.yaml create mode 100644 .github/workflows/PR-3.4.yaml diff --git a/.github/workflows/PR-3.4-ARM64.yaml b/.github/workflows/PR-3.4-ARM64.yaml deleted file mode 100644 index 9d8a1037bd..0000000000 --- a/.github/workflows/PR-3.4-ARM64.yaml +++ /dev/null @@ -1,209 +0,0 @@ -name: PR:3.4 ARM64 - -on: - pull_request: - branches: - - 3.4 - -env: - EXTRA_CMAKE_OPTIONS: '-DBUILD_DOCS=ON -DPYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3 -DOPENCV_DOWNLOAD_PATH=/home/ci/binaries_cache -DBUILD_opencv_xfeatures2d=OFF -DBUILD_EXAMPLES=ON -DOPENCV_ENABLE_NONFREE=ON' - PR_AUTHOR: ${{ github.event.pull_request.user.login }} - PR_AUTHOR_FORK: ${{ github.event.pull_request.head.repo.full_name }} - SOURCE_BRANCH_NAME: ${{ github.head_ref }} - TARGET_BRANCH_NAME: ${{ github.base_ref }} - ANT_HOME: '/usr/share/ant' - GIT_CACHE_DOCKER: '/home/ci/git_cache' - PYTHONPATH: /opencv-build/python_loader:$PYTHONPATH - OPENCV_TEST_DATA_PATH: '/opencv_extra/testdata' - OPENCV_DOCKER_WORKDIR: '/opencv' - DNN_MODELS: '/home/ci/dnn-models' - -jobs: - BuildAndTest: - runs-on: opencv-cn-lin-arm64 - defaults: - run: - shell: bash - container: - image: quay.io/opencv-ci/opencv-ubuntu:20.04-arm64 - volumes: - - /home/opencv-cn/git_cache:/home/ci/git_cache - - /home/opencv-cn/ci_cache/opencv:/home/ci/.ccache - - /home/opencv-cn/binaries_cache:/home/ci/binaries_cache - - /home/opencv-cn/dnn-models:/home/ci/dnn-models - steps: - - name: PR info - run: | - echo "PR Author: ${{ env.PR_AUTHOR }}" - echo "PR Author fork: ${{ env.PR_AUTHOR_FORK }}" - echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}" - echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}" - - name: Clean - run: find ${{ env.OPENCV_DOCKER_WORKDIR }} -mindepth 1 -delete - - name: Fetch opencv - run: git clone --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv.git https://github.com/opencv/opencv.git ${{ env.OPENCV_DOCKER_WORKDIR }} - - name: Merge opencv with ${{ env.SOURCE_BRANCH_NAME }} branch - run: | - cd ${{ env.OPENCV_DOCKER_WORKDIR }} - git config --global --add safe.directory ${{ env.OPENCV_DOCKER_WORKDIR }} - git config user.email "opencv.ci" - git config user.name "opencv.ci" - git pull -v "https://github.com/${{ env.PR_AUTHOR_FORK }}" "${{ env.SOURCE_BRANCH_NAME }}" - - name: Clone opencv_extra - run: git clone --single-branch --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv_extra.git https://github.com/opencv/opencv_extra.git /opencv_extra - - name: Merge opencv_extra with ${{ env.SOURCE_BRANCH_NAME }} branch - run: | - OPENCV_EXTRA_FORK=$(git ls-remote --heads "https://github.com/${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}") || true - if [[ ! -z "$OPENCV_EXTRA_FORK" ]]; then - echo "Merge opencv_extra with ${{ env.SOURCE_BRANCH_NAME }} branch" - cd /opencv_extra - git config user.email "opencv.ci" - git config user.name "opencv.ci" - git pull -v "https://github.com/${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}" - else - echo "No merge since ${{ env.PR_AUTHOR }}/opencv_extra does not have branch ${{ env.SOURCE_BRANCH_NAME }}" - fi - - name: Extra DNN models update - run: | - DOWNLOAD_MODELS_FILE='download_models.py' - LATEST_SAVED_HASH=$(cat ${{ env.DNN_MODELS }}/dnn/latest-hash-${{ env.TARGET_BRANCH_NAME }}.txt) - LATEST_HASH=$(sha256sum /opencv_extra/testdata/dnn/$DOWNLOAD_MODELS_FILE | awk '{print $1}') - if [[ $LATEST_HASH == $LATEST_SAVED_HASH ]]; then - echo "DNN models are up to date" - echo "OPENCV_DNN_TEST_DATA_PATH=${{ env.DNN_MODELS }}" >> $GITHUB_ENV - else - echo "Updating DNN models list" - echo "OPENCV_DNN_TEST_DATA_PATH=/home/ci/new-dnn-models" >> $GITHUB_ENV && OPENCV_DNN_TEST_DATA_PATH='/home/ci/new-dnn-models' - mkdir -p "$OPENCV_DNN_TEST_DATA_PATH" - rsync -a --exclude=$DOWNLOAD_MODELS_FILE ${{ env.DNN_MODELS }}/* $OPENCV_DNN_TEST_DATA_PATH - cp /opencv_extra/testdata/dnn/download_models.py $OPENCV_DNN_TEST_DATA_PATH/dnn - cd $OPENCV_DNN_TEST_DATA_PATH/dnn && python3 download_models.py - fi - - name: Configure OpenCV - run: | - cmake -G Ninja -B /opencv-build ${{ env.EXTRA_CMAKE_OPTIONS }} ${{ env.OPENCV_DOCKER_WORKDIR }} - - name: Build OpenCV - run: | - cd /opencv-build - ninja - - name: Accuracy:calib3d - run: cd /opencv-build && xvfb-run -a bin/opencv_test_calib3d - - name: Accuracy:core - run: cd /opencv-build && xvfb-run -a bin/opencv_test_core - - name: Accuracy:dnn - run: cd /opencv-build && xvfb-run -a bin/opencv_test_dnn - - name: Accuracy:features2d - run: cd /opencv-build && xvfb-run -a bin/opencv_test_features2d - - name: Accuracy:flann - run: cd /opencv-build && xvfb-run -a bin/opencv_test_flann - - name: Accuracy:highgui - run: cd /opencv-build && xvfb-run -a bin/opencv_test_highgui - - name: Accuracy:imgcodecs - run: cd /opencv-build && xvfb-run -a bin/opencv_test_imgcodecs - - name: Accuracy:imgproc - run: cd /opencv-build && xvfb-run -a bin/opencv_test_imgproc - - name: Accuracy:ml - run: cd /opencv-build && xvfb-run -a bin/opencv_test_ml - - name: Accuracy:objdetect - run: cd /opencv-build && xvfb-run -a bin/opencv_test_objdetect --gtest_filter="-Objdetect_QRCode_Close.regression/0:Objdetect_QRCode_Close.regression/4" - - name: Accuracy:photo - run: cd /opencv-build && xvfb-run -a bin/opencv_test_photo --gtest_filter="-Photo_CalibrateDebevec.regression" - - name: Accuracy:shape - run: cd /opencv-build && xvfb-run -a bin/opencv_test_shape - - name: Accuracy:stitching - run: cd /opencv-build && xvfb-run -a bin/opencv_test_stitching - - name: Accuracy:superres - run: cd /opencv-build && xvfb-run -a bin/opencv_test_superres - - name: Accuracy:video - run: cd /opencv-build && xvfb-run -a bin/opencv_test_video - - name: Accuracy:videoio - run: cd /opencv-build && xvfb-run -a bin/opencv_test_videoio - - name: Accuracy:videostab - run: cd /opencv-build && xvfb-run -a bin/opencv_test_videostab - - name: Performance:calib3d - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_calib3d --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:core - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_core --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:dnn - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_dnn --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:features2d - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_features2d --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:imgcodecs - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_imgcodecs --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:imgproc - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_imgproc --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:objdetect - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_objdetect --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter="-Perf_Objdetect_QRCode.detect/2:Perf_Objdetect_QRCode_Multi.decodeMulti*:Perf_Objdetect_QRCode_Multi.detectMulti*" - - name: Performance:photo - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_photo --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:stitching - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_stitching --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:superres - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_superres --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:video - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_video --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:videoio - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_videoio --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Python3 - run: | - cd ${{ env.OPENCV_DOCKER_WORKDIR }}/modules/python/test - python3 ./test.py --repo ../../../ -v - - name: Java - run: cd /opencv-build && xvfb-run -a python3 ${{ env.OPENCV_DOCKER_WORKDIR }}/modules/ts/misc/run.py . -a -t java - - name: Save Unit Test Results - uses: actions/upload-artifact@v3 - if: always() - with: - name: junit-html - path: /opencv-build/java_test/testResults/junit-noframes.html - - BuildContrib: - runs-on: opencv-cn-lin-arm64 - defaults: - run: - shell: bash - container: - image: quay.io/opencv-ci/opencv-ubuntu:20.04-arm64 - volumes: - - /home/opencv-cn/git_cache:/home/ci/git_cache - - /home/opencv-cn/ci_cache/opencv:/home/ci/.ccache - - /home/opencv-cn/binaries_cache:/home/ci/binaries_cache - steps: - - name: PR info - run: | - echo "PR Author: ${{ env.PR_AUTHOR }}" - echo "PR Author fork: ${{ env.PR_AUTHOR_FORK }}" - echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}" - echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}" - - name: Clean - run: find ${{ env.OPENCV_DOCKER_WORKDIR }} -mindepth 1 -delete - - name: Fetch opencv - run: git clone --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv.git https://github.com/opencv/opencv.git ${{ env.OPENCV_DOCKER_WORKDIR }} - - name: Merge opencv with a test branch - run: | - cd ${{ env.OPENCV_DOCKER_WORKDIR }} - git config --global --add safe.directory ${{ env.OPENCV_DOCKER_WORKDIR }} - git config user.email "opencv.ci" - git config user.name "opencv.ci" - git pull -v "https://github.com/${{ env.PR_AUTHOR_FORK }}" "${{ env.SOURCE_BRANCH_NAME }}" - - name: Clone opencv_contrib - run: git clone --single-branch --branch ${{ env.TARGET_BRANCH_NAME }} https://github.com/opencv/opencv_contrib.git /opencv_contrib - - name: Merge opencv_contrib with ${{ env.SOURCE_BRANCH_NAME }} branch - run: | - OPENCV_CONTRIB_FORK=$(git ls-remote --heads "https://github.com/${{ env.PR_AUTHOR }}/opencv_contrib" "${{ env.SOURCE_BRANCH_NAME }}") || true - if [[ ! -z "$OPENCV_CONTRIB_FORK" ]]; then - echo "Merge opencv_contrib with ${{ env.SOURCE_BRANCH_NAME }} branch" - cd /opencv_contrib - git config user.email "opencv.ci" - git config user.name "opencv.ci" - git pull -v "https://github.com/${{ env.PR_AUTHOR }}/opencv_contrib" "${{ env.SOURCE_BRANCH_NAME }}" - else - echo "No merge since ${{ env.PR_AUTHOR }}/opencv_contrib does not have branch ${{ env.SOURCE_BRANCH_NAME }}" - fi - - name: Configure OpenCV Contrib - run: | - cmake -G Ninja -B /opencv-contrib-build ${{ env.EXTRA_CMAKE_OPTIONS }} -DOPENCV_EXTRA_MODULES_PATH=/opencv_contrib/modules ${{ env.OPENCV_DOCKER_WORKDIR }} - - name: Build OpenCV Contrib - run: | - cd /opencv-contrib-build - ninja diff --git a/.github/workflows/PR-3.4-U20.yaml b/.github/workflows/PR-3.4-U20.yaml deleted file mode 100644 index 268d9dae8c..0000000000 --- a/.github/workflows/PR-3.4-U20.yaml +++ /dev/null @@ -1,213 +0,0 @@ -name: PR:3.4 U20 - -on: - pull_request: - branches: - - 3.4 - -env: - EXTRA_CMAKE_OPTIONS: '-DBUILD_DOCS=ON -DPYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3 -DOPENCV_DOWNLOAD_PATH=/home/ci/binaries_cache -DBUILD_EXAMPLES=ON -DOPENCV_ENABLE_NONFREE=ON' - PR_AUTHOR: ${{ github.event.pull_request.user.login }} - PR_AUTHOR_FORK: ${{ github.event.pull_request.head.repo.full_name }} - SOURCE_BRANCH_NAME: ${{ github.head_ref }} - TARGET_BRANCH_NAME: ${{ github.base_ref }} - ANT_HOME: '/usr/share/ant' - GIT_CACHE_DOCKER: '/home/ci/git_cache' - PYTHONPATH: /opencv-build/python_loader:$PYTHONPATH - OPENCV_TEST_DATA_PATH: '/opencv_extra/testdata' - OPENCV_DOCKER_WORKDIR: '/opencv' - DNN_MODELS: '/home/ci/dnn-models' - -jobs: - BuildAndTest: - runs-on: opencv-cn-lin-x86-64 - defaults: - run: - shell: bash - container: - image: quay.io/opencv-ci/opencv-ubuntu:20.04 - volumes: - - /home/opencv-cn/git_cache:/home/ci/git_cache - - /home/opencv-cn/ci_cache/opencv:/home/ci/.ccache - - /home/opencv-cn/binaries_cache:/home/ci/binaries_cache - - /home/opencv-cn/dnn-models:/home/ci/dnn-models - steps: - - name: PR info - run: | - echo "PR Author: ${{ env.PR_AUTHOR }}" - echo "PR Author fork: ${{ env.PR_AUTHOR_FORK }}" - echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}" - echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}" - - name: Clean - run: find ${{ env.OPENCV_DOCKER_WORKDIR }} -mindepth 1 -delete - - name: Fetch opencv - run: git clone --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv.git https://github.com/opencv/opencv.git ${{ env.OPENCV_DOCKER_WORKDIR }} - - name: Merge opencv with ${{ env.SOURCE_BRANCH_NAME }} branch - run: | - cd ${{ env.OPENCV_DOCKER_WORKDIR }} - git config --global --add safe.directory ${{ env.OPENCV_DOCKER_WORKDIR }} - git config user.email "opencv.ci" - git config user.name "opencv.ci" - git pull -v "https://github.com/${{ env.PR_AUTHOR_FORK }}" "${{ env.SOURCE_BRANCH_NAME }}" - - name: Clone opencv_extra - run: git clone --single-branch --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv_extra.git https://github.com/opencv/opencv_extra.git /opencv_extra - - name: Merge opencv_extra with ${{ env.SOURCE_BRANCH_NAME }} branch - run: | - OPENCV_EXTRA_FORK=$(git ls-remote --heads "https://github.com/${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}") || true - if [[ ! -z "$OPENCV_EXTRA_FORK" ]]; then - echo "Merge opencv_extra with ${{ env.SOURCE_BRANCH_NAME }} branch" - cd /opencv_extra - git config user.email "opencv.ci" - git config user.name "opencv.ci" - git pull -v "https://github.com/${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}" - else - echo "No merge since ${{ env.PR_AUTHOR }}/opencv_extra does not have branch ${{ env.SOURCE_BRANCH_NAME }}" - fi - - name: Extra DNN models update - run: | - DOWNLOAD_MODELS_FILE='download_models.py' - LATEST_SAVED_HASH=$(cat ${{ env.DNN_MODELS }}/dnn/latest-hash-${{ env.TARGET_BRANCH_NAME }}.txt) - LATEST_HASH=$(sha256sum /opencv_extra/testdata/dnn/$DOWNLOAD_MODELS_FILE | awk '{print $1}') - if [[ $LATEST_HASH == $LATEST_SAVED_HASH ]]; then - echo "DNN models are up to date" - echo "OPENCV_DNN_TEST_DATA_PATH=${{ env.DNN_MODELS }}" >> $GITHUB_ENV - else - echo "Updating DNN models list" - echo "OPENCV_DNN_TEST_DATA_PATH=/home/ci/new-dnn-models" >> $GITHUB_ENV && OPENCV_DNN_TEST_DATA_PATH='/home/ci/new-dnn-models' - mkdir -p "$OPENCV_DNN_TEST_DATA_PATH" - rsync -a --exclude=$DOWNLOAD_MODELS_FILE ${{ env.DNN_MODELS }}/* $OPENCV_DNN_TEST_DATA_PATH - cp /opencv_extra/testdata/dnn/download_models.py $OPENCV_DNN_TEST_DATA_PATH/dnn - cd $OPENCV_DNN_TEST_DATA_PATH/dnn && python3 download_models.py - fi - - name: Configure OpenCV - run: | - cd /opencv-build - cmake -G Ninja ${{ env.EXTRA_CMAKE_OPTIONS }} ${{ env.OPENCV_DOCKER_WORKDIR }} - - name: Build OpenCV - run: | - cd /opencv-build - ninja - - name: Accuracy:calib3d - run: cd /opencv-build && xvfb-run -a bin/opencv_test_calib3d - - name: Accuracy:core - run: cd /opencv-build && xvfb-run -a bin/opencv_test_core - - name: Accuracy:dnn - run: cd /opencv-build && xvfb-run -a bin/opencv_test_dnn - - name: Accuracy:features2d - run: cd /opencv-build && xvfb-run -a bin/opencv_test_features2d - - name: Accuracy:flann - run: cd /opencv-build && xvfb-run -a bin/opencv_test_flann - - name: Accuracy:highgui - run: cd /opencv-build && xvfb-run -a bin/opencv_test_highgui - - name: Accuracy:imgcodecs - run: cd /opencv-build && xvfb-run -a bin/opencv_test_imgcodecs - - name: Accuracy:imgproc - run: cd /opencv-build && xvfb-run -a bin/opencv_test_imgproc - - name: Accuracy:ml - run: cd /opencv-build && xvfb-run -a bin/opencv_test_ml - - name: Accuracy:objdetect - run: cd /opencv-build && xvfb-run -a bin/opencv_test_objdetect - - name: Accuracy:photo - run: cd /opencv-build && xvfb-run -a bin/opencv_test_photo - - name: Accuracy:shape - run: cd /opencv-build && xvfb-run -a bin/opencv_test_shape - - name: Accuracy:stitching - run: cd /opencv-build && xvfb-run -a bin/opencv_test_stitching - - name: Accuracy:superres - run: cd /opencv-build && xvfb-run -a bin/opencv_test_superres - - name: Accuracy:video - run: cd /opencv-build && xvfb-run -a bin/opencv_test_video - - name: Accuracy:videoio - run: cd /opencv-build && xvfb-run -a bin/opencv_test_videoio - - name: Accuracy:videostab - run: cd /opencv-build && xvfb-run -a bin/opencv_test_videostab - - name: Performance:calib3d - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_calib3d --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:core - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_core --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:dnn - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_dnn --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:features2d - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_features2d --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:imgcodecs - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_imgcodecs --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:imgproc - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_imgproc --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:objdetect - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_objdetect --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:photo - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_photo --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:stitching - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_stitching --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:superres - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_superres --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:video - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_video --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Performance:videoio - run: cd /opencv-build && xvfb-run -a bin/opencv_perf_videoio --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 - - name: Python3 - run: | - cd ${{ env.OPENCV_DOCKER_WORKDIR }}/modules/python/test - python3 ./test.py --repo ../../../ -v - - name: Java - run: cd /opencv-build && xvfb-run -a python3 ${{ env.OPENCV_DOCKER_WORKDIR }}/modules/ts/misc/run.py . -a -t java - - name: Save Unit Test Results - uses: actions/upload-artifact@v3 - if: always() - with: - name: junit-html - path: /opencv-build/java_test/testResults/junit-noframes.html - - name: Pylint - run: cd /opencv-build && cmake --build . --config release --target check_pylint -- -j4 - - BuildContrib: - runs-on: opencv-cn-lin-x86-64 - defaults: - run: - shell: bash - container: - image: quay.io/opencv-ci/opencv-ubuntu:20.04 - volumes: - - /home/opencv-cn/git_cache:/home/ci/git_cache - - /home/opencv-cn/ci_cache/opencv:/home/ci/.ccache - - /home/opencv-cn/binaries_cache:/home/ci/binaries_cache - steps: - - name: PR info - run: | - echo "PR Author: ${{ env.PR_AUTHOR }}" - echo "PR Author fork: ${{ env.PR_AUTHOR_FORK }}" - echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}" - echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}" - - name: Clean - run: find ${{ env.OPENCV_DOCKER_WORKDIR }} -mindepth 1 -delete - - name: Fetch opencv - run: git clone --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv.git https://github.com/opencv/opencv.git ${{ env.OPENCV_DOCKER_WORKDIR }} - - name: Merge opencv with a test branch - run: | - cd ${{ env.OPENCV_DOCKER_WORKDIR }} - git config --global --add safe.directory ${{ env.OPENCV_DOCKER_WORKDIR }} - git config user.email "opencv.ci" - git config user.name "opencv.ci" - git pull -v "https://github.com/${{ env.PR_AUTHOR_FORK }}" "${{ env.SOURCE_BRANCH_NAME }}" - - name: Clone opencv_contrib - run: git clone --single-branch --branch ${{ env.TARGET_BRANCH_NAME }} https://github.com/opencv/opencv_contrib.git /opencv_contrib - - name: Merge opencv_contrib with ${{ env.SOURCE_BRANCH_NAME }} branch - run: | - OPENCV_CONTRIB_FORK=$(git ls-remote --heads "https://github.com/${{ env.PR_AUTHOR }}/opencv_contrib" "${{ env.SOURCE_BRANCH_NAME }}") || true - if [[ ! -z "$OPENCV_CONTRIB_FORK" ]]; then - echo "Merge opencv_contrib with ${{ env.SOURCE_BRANCH_NAME }} branch" - cd /opencv_contrib - git config user.email "opencv.ci" - git config user.name "opencv.ci" - git pull -v "https://github.com/${{ env.PR_AUTHOR }}/opencv_contrib" "${{ env.SOURCE_BRANCH_NAME }}" - else - echo "No merge since ${{ env.PR_AUTHOR }}/opencv_contrib does not have branch ${{ env.SOURCE_BRANCH_NAME }}" - fi - - name: Configure OpenCV Contrib - run: | - cd /opencv-contrib-build - cmake -G Ninja ${{ env.EXTRA_CMAKE_OPTIONS }} -DOPENCV_EXTRA_MODULES_PATH=/opencv_contrib/modules ${{ env.OPENCV_DOCKER_WORKDIR }} - - name: Build OpenCV Contrib - run: | - cd /opencv-contrib-build - ninja diff --git a/.github/workflows/PR-3.4-W10.yaml b/.github/workflows/PR-3.4-W10.yaml deleted file mode 100644 index 4aad117d0f..0000000000 --- a/.github/workflows/PR-3.4-W10.yaml +++ /dev/null @@ -1,180 +0,0 @@ -name: PR:3.4 W10 - -on: - pull_request: - branches: - - 3.4 - -env: - EXTRA_CMAKE_OPTIONS: '-DCL_Z_OPTION=/Z7 -DOPENCV_DOWNLOAD_PATH=%BINARIES_CACHE% -DBUILD_EXAMPLES=ON -DOPENCV_ENABLE_NONFREE=ON -DCMAKE_BUILD_TYPE=Release' - OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata - PR_AUTHOR: ${{ github.event.pull_request.user.login }} - PR_AUTHOR_FORK: ${{ github.event.pull_request.head.repo.full_name }} - SOURCE_BRANCH_NAME: ${{ github.head_ref }} - TARGET_BRANCH_NAME: ${{ github.base_ref }} - GTEST_FILTER_STRING: '-Samples.findFile' - -jobs: - BuildAndTest: - runs-on: opencv-cn-win - defaults: - run: - shell: cmd - steps: - - name: PR info - run: | - echo "PR Author: ${{ env.PR_AUTHOR }}" - echo "PR Author fork: ${{ env.PR_AUTHOR_FORK }}" - echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}" - echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}" - - name: Clean - run: cd ${{ github.workspace }} && rm -rf * - - name: Fetch opencv - run: cd ${{ github.workspace }} && git clone --branch ${{ env.TARGET_BRANCH_NAME }} --reference %GIT_CACHE%\opencv.git git@github.com:opencv/opencv.git - - name: Merge opencv with ${{ env.SOURCE_BRANCH_NAME }} branch - run: | - cd ${{ github.workspace }}\opencv - git config user.email "opencv.ci" - git config user.name "opencv.ci" - git pull -v "git@github.com:${{ env.PR_AUTHOR_FORK }}" "${{ env.SOURCE_BRANCH_NAME }}" - - name: Fetch opencv_extra - run: cd ${{ github.workspace }} && git clone --single-branch --branch ${{ env.TARGET_BRANCH_NAME }} --reference %GIT_CACHE%\opencv_extra.git git@github.com:opencv/opencv_extra.git - - name: Merge opencv_extra with ${{ env.SOURCE_BRANCH_NAME }} branch - shell: bash - run: | - OPENCV_EXTRA_FORK=$(git ls-remote --heads "git@github.com:/${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}") || true - if [[ ! -z "$OPENCV_EXTRA_FORK" ]]; then - echo "Merge opencv_extra with ${{ env.SOURCE_BRANCH_NAME }} branch" - cd opencv_extra - git config user.email "opencv.ci" - git config user.name "opencv.ci" - git pull -v "git@github.com:${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}" - else - echo "No merge since ${{ env.PR_AUTHOR }}/opencv_extra does not have branch ${{ env.SOURCE_BRANCH_NAME }}" - fi - - name: Configure OpenCV - run: | - mkdir ${{ github.workspace }}\opencv-build && cd ${{ github.workspace }}\opencv-build - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" - cmake -G Ninja ${{ env.EXTRA_CMAKE_OPTIONS }} ${{ github.workspace }}\opencv - - name: Build OpenCV - run: | - cd ${{ github.workspace }}\opencv-build - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" - ninja - - name: Accuracy:calib3d - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_calib3d.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Accuracy:core - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_core.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Accuracy:dnn - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_dnn.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Accuracy:features2d - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_features2d.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Accuracy:flann - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_flann.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Accuracy:highgui - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_highgui.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Accuracy:imgcodecs - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_imgcodecs.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Accuracy:imgproc - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_imgproc.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Accuracy:ml - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_ml.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Accuracy:objdetect - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_objdetect.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Accuracy:photo - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_photo.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Accuracy:shape - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_shape.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Accuracy:stitching - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_stitching.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Accuracy:superres - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_superres.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Accuracy:video - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_video.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Accuracy:videoio - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_videoio.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Accuracy:videostab - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_test_videostab.exe --skip_unstable --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Performance:calib3d - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_perf_calib3d.exe --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Performance:core - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_perf_core.exe --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Performance:dnn - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_perf_dnn.exe --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Performance:features2d - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_perf_features2d.exe --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Performance:imgcodecs - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_perf_imgcodecs.exe --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Performance:imgproc - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_perf_imgproc.exe --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Performance:objdetect - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_perf_objdetect.exe --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Performance:photo - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_perf_photo.exe --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Performance:stitching - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_perf_stitching.exe --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Performance:superres - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_perf_superres.exe --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Performance:video - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_perf_video.exe --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Performance:videoio - run: cd ${{ github.workspace }}\opencv-build && bin\opencv_perf_videoio.exe --perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --gtest_filter=${{ env.GTEST_FILTER_STRING }} - - name: Python3 - run: | - cd ${{ github.workspace }}\opencv\modules\python\test - set PYTHONPATH=%PYTHONPATH%;${{ github.workspace }}\opencv-build\python_loader;${{ github.workspace }}\opencv-build\lib\python3 - set PATH=%PATH%;${{ github.workspace }}\opencv-build\bin;${{ github.workspace }}\opencv-build\lib\python3 - python test.py --repo ..\..\..\ -v - - name: Java - run: | - cd ${{ github.workspace }}\opencv-build - set PATH=%PATH%;${{ github.workspace }}\opencv-build\bin - ${{ github.workspace }}\opencv\modules\ts\misc\run.py . -a -t java - BuildContrib: - runs-on: opencv-cn-win - defaults: - run: - shell: cmd - steps: - - name: PR info - run: | - echo "PR Author: ${{ env.PR_AUTHOR }}" - echo "PR Author fork: ${{ env.PR_AUTHOR_FORK }}" - echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}" - echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}" - - name: Clean - run: cd ${{ github.workspace }} && rm -rf * - - name: Fetch opencv - run: cd ${{ github.workspace }} && git clone --branch ${{ env.TARGET_BRANCH_NAME }} --reference %GIT_CACHE%\opencv.git git@github.com:opencv/opencv.git - - name: Merge opencv with ${{ env.SOURCE_BRANCH_NAME }} branch - run: | - cd ${{ github.workspace }}\opencv - git config user.email "opencv.ci" - git config user.name "opencv.ci" - git pull -v "git@github.com:${{ env.PR_AUTHOR_FORK }}" "${{ env.SOURCE_BRANCH_NAME }}" - - name: Fetch opencv_contrib - run: cd ${{ github.workspace }} && git clone --single-branch --branch ${{ env.TARGET_BRANCH_NAME }} --reference %GIT_CACHE%\opencv_contrib.git --depth 1 git@github.com:opencv/opencv_contrib.git - - name: Merge opencv_contrib with ${{ env.SOURCE_BRANCH_NAME }} branch - shell: bash - run: | - OPENCV_CONTRIB_FORK=$(git ls-remote --heads "git@github.com:${{ env.PR_AUTHOR }}/opencv_contrib" "${{ env.SOURCE_BRANCH_NAME }}") || true - if [[ ! -z "$OPENCV_CONTRIB_FORK" ]]; then - echo "Merge opencv_contrib with ${{ env.SOURCE_BRANCH_NAME }} branch" - cd opencv_contrib - git config user.email "opencv.ci" - git config user.name "opencv.ci" - git pull -v "git@github.com:${{ env.PR_AUTHOR }}/opencv_contrib" "${{ env.SOURCE_BRANCH_NAME }}" - else - echo "No merge since ${{ env.PR_AUTHOR }}/opencv_contrib does not have branch ${{ env.SOURCE_BRANCH_NAME }}" - fi - - name: Configure OpenCV Contrib - run: | - mkdir ${{ github.workspace }}\opencv-contrib-build && cd ${{ github.workspace }}\opencv-contrib-build - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" - cmake -G Ninja ${{ env.EXTRA_CMAKE_OPTIONS }} -DOPENCV_EXTRA_MODULES_PATH=${{ github.workspace }}\opencv_contrib\modules ${{ github.workspace }}\opencv - - name: Build OpenCV Contrib - run: | - cd ${{ github.workspace }}\opencv-contrib-build - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" - ninja diff --git a/.github/workflows/PR-3.4.yaml b/.github/workflows/PR-3.4.yaml new file mode 100644 index 0000000000..a1efca8c26 --- /dev/null +++ b/.github/workflows/PR-3.4.yaml @@ -0,0 +1,16 @@ +name: PR:3.4 + +on: + pull_request: + branches: + - 3.4 + +jobs: + ARM64: + uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-3.4-ARM64.yaml@main + + U20: + uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-3.4-U20.yaml@main + + W10: + uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-3.4-W10.yaml@main \ No newline at end of file From 93dc0679ec93fe6a152f4f1c238da9cdc6aa00ed Mon Sep 17 00:00:00 2001 From: rogday Date: Mon, 23 May 2022 17:50:42 +0300 Subject: [PATCH 6/6] Merge pull request #21818 from rogday:revert_renaming * add prefixes to layer names and layer output names * dnn: OPENCV_DNN_ONNX_USE_LEGACY_NAMES runtime parameter Co-authored-by: Alexander Alekhin --- modules/dnn/src/onnx/onnx_importer.cpp | 27 +++++++++++++++++++++---- modules/dnn/test/test_onnx_importer.cpp | 5 +++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/modules/dnn/src/onnx/onnx_importer.cpp b/modules/dnn/src/onnx/onnx_importer.cpp index e755226535..e4cbe02840 100644 --- a/modules/dnn/src/onnx/onnx_importer.cpp +++ b/modules/dnn/src/onnx/onnx_importer.cpp @@ -15,6 +15,9 @@ #define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_VERBOSE + 1 #include +#include + + #ifdef HAVE_PROTOBUF #include @@ -78,6 +81,7 @@ public: ONNXImporter(Net& net, const char *onnxFile) : dstNet(net), dispatch(buildDispatchMap()) , onnx_opset(0) + , useLegacyNames(getParamUseLegacyNames()) { hasDynamicShapes = false; CV_Assert(onnxFile); @@ -100,6 +104,7 @@ public: ONNXImporter(Net& net, const char* buffer, size_t sizeBuffer) : dstNet(net), dispatch(buildDispatchMap()) , onnx_opset(0) + , useLegacyNames(getParamUseLegacyNames()) { hasDynamicShapes = false; CV_LOG_DEBUG(NULL, "DNN/ONNX: processing in-memory ONNX model (" << sizeBuffer << " bytes)"); @@ -196,8 +201,18 @@ private: int onnx_opset; // OperatorSetIdProto for 'onnx' domain void parseOperatorSet(); + + + bool useLegacyNames; + bool getParamUseLegacyNames() + { + bool param = utils::getConfigurationParameterBool("OPENCV_DNN_ONNX_USE_LEGACY_NAMES", false); + return param; + } + const std::string extractNodeName(const opencv_onnx::NodeProto& node_proto); }; + inline void replaceLayerParam(LayerParams& layerParams, const String& oldKey, const String& newKey) { if (layerParams.has(oldKey)) { @@ -720,12 +735,14 @@ void ONNXImporter::populateNet() CV_LOG_DEBUG(NULL, "DNN/ONNX: import completed!"); } -static -const std::string& extractNodeName(const opencv_onnx::NodeProto& node_proto) +const std::string ONNXImporter::extractNodeName(const opencv_onnx::NodeProto& node_proto) { + // We need to rework DNN outputs API, this is a workaround for #21698 if (node_proto.has_name() && !node_proto.name().empty()) { - return node_proto.name(); + if (useLegacyNames) + return node_proto.name(); + return cv::format("onnx_node!%s", node_proto.name().c_str()); } for (int i = 0; i < node_proto.output_size(); ++i) { @@ -735,7 +752,9 @@ const std::string& extractNodeName(const opencv_onnx::NodeProto& node_proto) // the second method is to use an empty string in place of an input or output name. if (!name.empty()) { - return name; + if (useLegacyNames) + return name.c_str(); + return cv::format("onnx_node_output_%d!%s", i, name.c_str()); } } CV_Error(Error::StsAssert, "Couldn't deduce Node name."); diff --git a/modules/dnn/test/test_onnx_importer.cpp b/modules/dnn/test/test_onnx_importer.cpp index afe80efaf1..60473ede58 100644 --- a/modules/dnn/test/test_onnx_importer.cpp +++ b/modules/dnn/test/test_onnx_importer.cpp @@ -1389,6 +1389,11 @@ TEST_P(Test_ONNX_layers, DivConst) testONNXModels("div_const"); } +TEST_P(Test_ONNX_layers, OutputRegistration) +{ + testONNXModels("output_registration", npy, 0, 0, false, true, 2); +} + INSTANTIATE_TEST_CASE_P(/*nothing*/, Test_ONNX_layers, dnnBackendsAndTargets()); class Test_ONNX_nets : public Test_ONNX_layers