diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels_linux.yml similarity index 79% rename from .github/workflows/build_wheels.yml rename to .github/workflows/build_wheels_linux.yml index 67f7ad8d..bbb7f7fe 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -1,83 +1,17 @@ -name: Build PYPI wheels for opencv-python +name: Build PYPI wheels for opencv-python on Linux x86_64 on: + push: + branches: + - gs/fix-submodules-checkout pull_request: branches: - - master + - 3.4 release: types: [published, edited] jobs: - build-windows-x86_64: - runs-on: ${{ matrix.os }} - defaults: - run: - shell: powershell - - strategy: - fail-fast: false - matrix: - os: [windows-latest] - python-version: [3.6, 3.7, 3.8, 3.9] - platform: [x86, x64] - with_contrib: [0, 1] - without_gui: [0, 1] - build_sdist: [0] - - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - SDIST: ${{ matrix.build_sdist || 0}} - ENABLE_HEADLESS: ${{ matrix.without_gui }} - ENABLE_CONTRIB: ${{ matrix.with_contrib }} - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - submodules: true - fetch-depth: 0 - - - name: Update submodules - run: | - git submodule update --remote - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.platform }} - - - name: Setup MSBuild.exe - uses: warrenbuckley/Setup-MSBuild@v1 - - - name: build script - run: | - python --version - python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - set "CI_BUILD=1" && python -m pip wheel --wheel-dir=%cd%\wheelhouse . --verbose - shell: cmd - - - name: before test - run: | - cd ${{ github.workspace }}/tests - &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") - if ($LastExitCode -ne 0) {throw $LastExitCode} - shell: powershell - - - name: run test - run: | - cd ${{ github.workspace }}/tests - python -m unittest test - shell: cmd - - - name: saving artifacts - uses: actions/upload-artifact@v2 - with: - name: wheels - path: wheelhouse/opencv*.whl - build: runs-on: ${{ matrix.os }} defaults: @@ -87,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest] python-version: [3.6, 3.7, 3.8, 3.9] platform: [x64] with_contrib: [0, 1] @@ -116,12 +50,15 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - submodules: true + submodules: false fetch-depth: 0 + - name: Update multibuild submodule + run: git submodule update --init --recursive multibuild + - name: Update submodules - run: | - git submodule update --remote + if: github.event_name == 'pull_request' + run: git submodule update --remote - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 @@ -140,7 +77,7 @@ jobs: echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; - - name: before install + - name: build run: | set -e # Check out and prepare the source @@ -157,8 +94,32 @@ jobs: echo $ENABLE_HEADLESS > headless.enabled set -x build_wheel $REPO_DIR $PLAT + + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: install and test + run: | + set -e + # Check out and prepare the source + # Multibuild doesn't have releases, so --depth would break eventually (see + # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) + git submodule update --init multibuild + source multibuild/common_utils.sh + # https://github.com/matthew-brett/multibuild/issues/116 + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi + source multibuild/travis_steps.sh + # This sets -x + # source travis_multibuild_customize.sh + echo $ENABLE_CONTRIB > contrib.enabled + echo $ENABLE_HEADLESS > headless.enabled + set -x install_run $PLAT set +x + - name: saving artifacts uses: actions/upload-artifact@v2 with: @@ -205,10 +166,14 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - submodules: true + submodules: false fetch-depth: 0 + - name: Update multibuild submodule + run: git submodule update --init --recursive multibuild + - name: Update submodules + if: github.event_name == 'pull_request' run: | git submodule update --remote @@ -238,6 +203,7 @@ jobs: # Install and run tests set -x echo "skipping tests because of sdist" + - name: saving artifacts uses: actions/upload-artifact@v2 with: @@ -246,7 +212,7 @@ jobs: test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build, build-windows-x86_64, build_sdist] + needs: [build, build_sdist] runs-on: ubuntu-latest environment: test-opencv-python-release defaults: @@ -265,7 +231,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build, build-windows-x86_64, build_sdist] + needs: [build, build_sdist] runs-on: ubuntu-latest environment: opencv-python-release defaults: diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml new file mode 100644 index 00000000..01158eec --- /dev/null +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -0,0 +1,177 @@ +name: Build PYPI wheels for opencv-python on Linux ARM + +on: + push: + branches: + - asen/check_3.4_wo_submodules + pull_request: + branches: + - 3.4 + release: + types: [published, edited] + + +jobs: + build_arm: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + os: [ARM64] + python-version: [3.6, 3.7, 3.8, 3.9] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + REPO_DIR: . + BUILD_COMMIT: master + PROJECT_SPEC: opencv-python + MB_PYTHON_VERSION: ${{ matrix.python-version }} + TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} + PLAT: aarch64 + MB_ML_VER: 2014 + NP_TEST_DEP: numpy + TRAVIS_BUILD_DIR: ${{ github.workspace }} + CONFIG_PATH: travis_config.sh + DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} + DOCKER_TEST_IMAGE: multibuild/xenial_arm64v8 + USE_CCACHE: 0 + UNICODE_WIDTH: 32 + SDIST: ${{ matrix.build_sdist || 0}} + ENABLE_HEADLESS: ${{ matrix.without_gui }} + ENABLE_CONTRIB: ${{ matrix.with_contrib }} + + steps: + - name: Cleanup + if: always() + uses: AutoModality/action-clean@v1 + + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: false + fetch-depth: 0 + + - name: Update multibuild submodule + run: git submodule update --init --recursive multibuild + + - name: Update submodules + if: github.event_name == 'pull_request' + run: git submodule update --remote + + - name: Setup Environment variables + run: | + if [ "ARM64" == "${{ matrix.os }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; fi + echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; + echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; + + - name: before install + run: | + set -e + if [[ $SDIST == 0 ]]; then + # Check out and prepare the source + # Multibuild doesn't have releases, so --depth would break eventually (see + # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) + git submodule update --init multibuild + source multibuild/common_utils.sh + # https://github.com/matthew-brett/multibuild/issues/116 + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi + source multibuild/travis_steps.sh + # This sets -x + # source travis_multibuild_customize.sh + echo $ENABLE_CONTRIB > contrib.enabled + echo $ENABLE_HEADLESS > headless.enabled + echo "end" + # Not interested in travis internal scripts' output + fi + set +x + # Build and package + set -x + ls + if [[ $SDIST == 1 ]]; then + python -m pip install --upgrade pip + python -m pip install scikit-build + python setup.py sdist + else + build_wheel $REPO_DIR $PLAT + fi + set +x + # Install and run tests + set -x + if [[ $SDIST == 1 ]]; then + echo "skipping tests because of sdist" + rc=0 + else + install_run $PLAT && rc=$? || rc=$? + fi + set +x + #otherwise, Travis logic terminates prematurely + #https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817 + trap ERR + test "$rc" -eq 0 + + - name: saving artifacts + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + + test_release_opencv_python: + if: github.event_name == 'release' && github.event.release.prerelease + needs: [build_arm] + runs-on: ubuntu-latest + environment: test-opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload all wheels + run: | + python -m pip install twine + python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* + + release_opencv_python: + if: github.event_name == 'release' && !github.event.release.prerelease + needs: [build_arm] + runs-on: ubuntu-latest + environment: opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload wheels for opencv_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* + + - name: Upload wheels for opencv_contrib_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* + + - name: Upload wheels for opencv_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* + + - name: Upload wheels for opencv_contrib_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml new file mode 100644 index 00000000..9af6d384 --- /dev/null +++ b/.github/workflows/build_wheels_macos.yml @@ -0,0 +1,157 @@ +name: Build PYPI wheels for opencv-python on Macos + +on: + push: + branches: + - asen/check_3.4_wo_submodules + pull_request: + branches: + - 3.4 + release: + types: [published, edited] + + +jobs: + build: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + os: [macos-latest] + python-version: [3.6, 3.7, 3.8, 3.9] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + REPO_DIR: . + BUILD_COMMIT: master + PROJECT_SPEC: opencv-python + MB_PYTHON_VERSION: ${{ matrix.python-version }} + TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} + MB_ML_VER: 2014 + NP_TEST_DEP: numpy + TRAVIS_BUILD_DIR: ${{ github.workspace }} + CONFIG_PATH: travis_config.sh + DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} + USE_CCACHE: 1 + UNICODE_WIDTH: 32 + SDIST: ${{ matrix.build_sdist || 0}} + ENABLE_HEADLESS: ${{ matrix.without_gui }} + ENABLE_CONTRIB: ${{ matrix.with_contrib }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: false + fetch-depth: 0 + + - name: Update multibuild submodule + run: git submodule update --init --recursive multibuild + + - name: Update submodules + if: github.event_name == 'pull_request' + run: git submodule update --remote + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + if: ${{ 'macos-latest' == matrix.os }} + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform }} + + - name: Setup Environment variables + run: | + if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi + if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi + if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi + if [ "x64" == "${{ matrix.platform }}" ]; then echo "PLAT=x86_64" >> $GITHUB_ENV; fi + if [ "x86" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; fi + echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; + echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; + + - name: before install + run: | + set -e + # Check out and prepare the source + # Multibuild doesn't have releases, so --depth would break eventually (see + # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) + git submodule update --init multibuild + source multibuild/common_utils.sh + # https://github.com/matthew-brett/multibuild/issues/116 + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi + source multibuild/travis_steps.sh + # This sets -x + # source travis_multibuild_customize.sh + echo $ENABLE_CONTRIB > contrib.enabled + echo $ENABLE_HEADLESS > headless.enabled + set -x + build_wheel $REPO_DIR $PLAT + install_run $PLAT + set +x + + - name: saving artifacts + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + + test_release_opencv_python: + if: github.event_name == 'release' && github.event.release.prerelease + needs: [build] + runs-on: ubuntu-latest + environment: test-opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload all wheels + run: | + python -m pip install twine + python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* + + release_opencv_python: + if: github.event_name == 'release' && !github.event.release.prerelease + needs: [build] + runs-on: ubuntu-latest + environment: opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload wheels for opencv_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* + + - name: Upload wheels for opencv_contrib_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* + + - name: Upload wheels for opencv_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* + + - name: Upload wheels for opencv_contrib_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml new file mode 100644 index 00000000..64f02cca --- /dev/null +++ b/.github/workflows/build_wheels_windows.yml @@ -0,0 +1,138 @@ +name: Build PYPI wheels for opencv-python on Windows + +on: + push: + branches: + - asen/check_3.4_wo_submodules + pull_request: + branches: + - 3.4 + release: + types: [published, edited] + + +jobs: + build-windows-x86_64: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: powershell + + strategy: + fail-fast: false + matrix: + os: [windows-latest] + python-version: [3.6, 3.7, 3.8, 3.9] + platform: [x86, x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + SDIST: ${{ matrix.build_sdist || 0}} + ENABLE_HEADLESS: ${{ matrix.without_gui }} + ENABLE_CONTRIB: ${{ matrix.with_contrib }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: false + fetch-depth: 0 + + - name: Update multibuild submodule + run: git submodule update --init --recursive multibuild + + - name: Update submodules + if: github.event_name == 'pull_request' + run: git submodule update --remote + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform }} + + - name: Setup MSBuild.exe + uses: warrenbuckley/Setup-MSBuild@v1 + + - name: build script + run: | + python --version + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools + set "CI_BUILD=1" && python -m pip wheel --wheel-dir=%cd%\wheelhouse . --verbose + shell: cmd + + - name: before test + run: | + cd ${{ github.workspace }}/tests + &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") + if ($LastExitCode -ne 0) {throw $LastExitCode} + shell: powershell + + - name: run test + run: | + cd ${{ github.workspace }}/tests + python -m unittest test + shell: cmd + + - name: saving artifacts + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + + test_release_opencv_python: + if: github.event_name == 'release' && github.event.release.prerelease + needs: [build-windows-x86_64] + runs-on: ubuntu-latest + environment: test-opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload all wheels + run: | + python -m pip install twine + python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* + + release_opencv_python: + if: github.event_name == 'release' && !github.event.release.prerelease + needs: [build-windows-x86_64] + runs-on: ubuntu-latest + environment: opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload wheels for opencv_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* + + - name: Upload wheels for opencv_contrib_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* + + - name: Upload wheels for opencv_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* + + - name: Upload wheels for opencv_contrib_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* diff --git a/.gitmodules b/.gitmodules index f2e0d283..8ebdff3d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,15 @@ [submodule "opencv"] path = opencv url = https://github.com/opencv/opencv.git + branch = 3.4 [submodule "opencv_contrib"] path = opencv_contrib url = https://github.com/opencv/opencv_contrib.git + branch = 3.4 [submodule "multibuild"] path = multibuild url = https://github.com/matthew-brett/multibuild.git +[submodule "opencv_extra"] + path = opencv_extra + url = https://github.com/opencv/opencv_extra.git + branch = 3.4 diff --git a/LICENSE-3RD-PARTY.txt b/LICENSE-3RD-PARTY.txt index 20f4fb37..87c0514e 100644 --- a/LICENSE-3RD-PARTY.txt +++ b/LICENSE-3RD-PARTY.txt @@ -1,208 +1,48 @@ OpenCV library is redistributed within opencv-python package. This license applies to OpenCV binary in the directory cv2/. +By downloading, copying, installing or using the software you agree to this license. +If you do not agree to this license, do not download, install, +copy or use the software. - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + + License Agreement + For Open Source Computer Vision Library + (3-clause BSD License) + +Copyright (C) 2000-2021, Intel Corporation, all rights reserved. +Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. +Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved. +Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. +Copyright (C) 2015-2021, OpenCV Foundation, all rights reserved. +Copyright (C) 2015-2016, Itseez Inc., all rights reserved. +Copyright (C) 2019-2021, Xperience AI, all rights reserved. +Third party copyrights are property of their respective owners. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the names of the copyright holders nor the names of the contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as is" and +any express or implied warranties, including, but not limited to, the implied +warranties of merchantability and fitness for a particular purpose are disclaimed. +In no event shall copyright holders or contributors be liable for any direct, +indirect, incidental, special, exemplary, or consequential damages +(including, but not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) however caused +and on any theory of liability, whether in contract, strict liability, +or tort (including negligence or otherwise) arising in any way out of +the use of this software, even if advised of the possibility of such damage. ------------------------------------------------------------------------------ libvpx is redistributed within all opencv-python Linux packages. diff --git a/README.md b/README.md index 232aa318..3b181532 100644 --- a/README.md +++ b/README.md @@ -171,13 +171,13 @@ On slow systems such as Raspberry Pi the full build may take several hours. On a Opencv-python package (scripts in this repository) is available under MIT license. -OpenCV itself is available under [Apache 2](https://github.com/opencv/opencv/blob/master/LICENSE) license. +OpenCV itself is available under [3-clause BSD License](https://github.com/opencv/opencv/blob/master/LICENSE). Third party package licenses are at [LICENSE-3RD-PARTY.txt](https://github.com/skvark/opencv-python/blob/master/LICENSE-3RD-PARTY.txt). All wheels ship with [FFmpeg](http://ffmpeg.org) licensed under the [LGPLv2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html). -Non-headless Linux and MacOS wheels ship with [Qt 5](http://doc.qt.io/qt-5/lgpl.html) licensed under the [LGPLv3](http://www.gnu.org/licenses/lgpl-3.0.html). +Non-headless Linux wheels ship with [Qt 5](http://doc.qt.io/qt-5/lgpl.html) licensed under the [LGPLv3](http://www.gnu.org/licenses/lgpl-3.0.html). The packages include also other binaries. Full list of licenses can be found from [LICENSE-3RD-PARTY.txt](https://github.com/skvark/opencv-python/blob/master/LICENSE-3RD-PARTY.txt). diff --git a/opencv b/opencv index 69357b1e..d0e3e638 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 69357b1e88680658a07cffde7678a4d697469f03 +Subproject commit d0e3e638c35d875c86fac3410d93f02f885e27ba diff --git a/opencv_contrib b/opencv_contrib index f5d7f671..4de4edeb 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit f5d7f6712d4ff229ba4f45cf79dfd11c557d56fd +Subproject commit 4de4edeba691d8ed0420f3581fb80133589f4cdf diff --git a/opencv_extra b/opencv_extra new file mode 160000 index 00000000..b6430dee --- /dev/null +++ b/opencv_extra @@ -0,0 +1 @@ +Subproject commit b6430deee16b91dce946a6e66feb8dc110c39834 diff --git a/setup.py b/setup.py index a3265206..a40488b1 100644 --- a/setup.py +++ b/setup.py @@ -97,7 +97,7 @@ def main(): # Path regexes with forward slashes relative to CMake install dir. rearrange_cmake_output_data = { "cv2": ( - [r"bin/opencv_videoio_ffmpeg\d{3}%s\.dll" % ("_64" if x64 else "")] + [r"bin/opencv_ffmpeg\d{3,4}%s\.dll" % ("_64" if x64 else "")] if os.name == "nt" else [] ) @@ -110,7 +110,7 @@ def main(): % {"ext": re.escape(sysconfig.get_config_var("EXT_SUFFIX"))} ], "cv2.data": [ # OPENCV_OTHER_INSTALL_PATH - ("etc" if os.name == "nt" else "share/opencv4") + r"/haarcascades/.*\.xml" + ("etc" if os.name == "nt" else "share/OpenCV") + r"/haarcascades/.*\.xml" ], } diff --git a/travis_config.sh b/travis_config.sh index aac66317..b1a991a4 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -146,24 +146,31 @@ function run_tests { echo "Run tests..." echo $PWD + PYTHON=python$PYTHON_VERSION + if [ -n "$IS_OSX" ]; then echo "Running for OS X" - cd ../tests/ + cd ../opencv/ + export OPENCV_TEST_DATA_PATH=../opencv_extra/testdata else echo "Running for linux" - cd /io/tests/ + + if [ $PYTHON == "python3.6" ]; then + $PYTHON -m pip install -U numpy==1.19.4 + fi + cd /io/opencv + export OPENCV_TEST_DATA_PATH=/io/opencv_extra/testdata fi test_wheels } function test_wheels { - PYTHON=python$PYTHON_VERSION echo "Starting tests..." #Test package - $PYTHON -m unittest test + $PYTHON modules/python/test/test.py -v --repo . } export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'