From 3f473c93fb6ff2ce57d2b9f5708e230803eb5678 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Fri, 29 Dec 2023 03:45:02 +0800 Subject: [PATCH] use opencv 4.9.0 by default --- .github/workflows/linux-cuda-gnu.yml | 2 +- .github/workflows/linux-precompile-cuda-gnu.yml | 2 +- .github/workflows/linux-precompile-gnu.yml | 2 +- .github/workflows/linux-precompile-musl.yml | 4 ++-- .../linux-precompile-x86_64-manylinux2014-gnu.yml | 2 +- .github/workflows/linux-x86_64.yml | 4 ++-- .github/workflows/macos-precompile.yml | 2 +- .github/workflows/macos-x86_64.yml | 2 +- .github/workflows/nerves-build.yml | 2 +- .github/workflows/test-python-compatibility.yml | 2 +- .github/workflows/windows-precompile-cuda.yml | 2 +- .github/workflows/windows-precompile.yml | 2 +- .github/workflows/windows-x86_64.yml | 2 +- Makefile | 4 ++-- Makefile.win | 4 ++-- README.md | 7 ++++--- mix.exs | 4 ++-- patches/apply_patch.py | 2 +- 18 files changed, 26 insertions(+), 25 deletions(-) diff --git a/.github/workflows/linux-cuda-gnu.yml b/.github/workflows/linux-cuda-gnu.yml index 85ef5726..e9e461ef 100644 --- a/.github/workflows/linux-cuda-gnu.yml +++ b/.github/workflows/linux-cuda-gnu.yml @@ -79,7 +79,7 @@ jobs: DEBIAN_FRONTEND: noninteractive # evision related env vars MIX_ENV: test - OPENCV_VER: "4.8.0" + OPENCV_VER: "4.9.0" OTP_VERSION: "25.2" ELIXIR_VERSION: "1.14.3" EVISION_PREFER_PRECOMPILED: "false" diff --git a/.github/workflows/linux-precompile-cuda-gnu.yml b/.github/workflows/linux-precompile-cuda-gnu.yml index c43627ba..96372c81 100644 --- a/.github/workflows/linux-precompile-cuda-gnu.yml +++ b/.github/workflows/linux-precompile-cuda-gnu.yml @@ -57,7 +57,7 @@ jobs: DEBIAN_FRONTEND: noninteractive # evision related env vars MIX_ENV: test - OPENCV_VER: "4.8.0" + OPENCV_VER: "4.9.0" ELIXIR_VERSION: "1.15.2" EVISION_PREFER_PRECOMPILED: "false" EVISION_GENERATE_LANG: "erlang,elixir" diff --git a/.github/workflows/linux-precompile-gnu.yml b/.github/workflows/linux-precompile-gnu.yml index 0f936a30..248dc67e 100644 --- a/.github/workflows/linux-precompile-gnu.yml +++ b/.github/workflows/linux-precompile-gnu.yml @@ -13,7 +13,7 @@ jobs: mix_compile: runs-on: ubuntu-20.04 env: - OPENCV_VER: "4.8.0" + OPENCV_VER: "4.9.0" MIX_ENV: prod ELIXIR_VERSION: "1.15.2" EVISION_PREFER_PRECOMPILED: "false" diff --git a/.github/workflows/linux-precompile-musl.yml b/.github/workflows/linux-precompile-musl.yml index b1133e19..947ddeff 100644 --- a/.github/workflows/linux-precompile-musl.yml +++ b/.github/workflows/linux-precompile-musl.yml @@ -15,7 +15,7 @@ jobs: container: alpine:latest env: MIX_ENV: prod - OPENCV_VER: "4.8.0" + OPENCV_VER: "4.9.0" EVISION_PREFER_PRECOMPILED: "false" EVISION_GENERATE_LANG: "erlang,elixir" strategy: @@ -158,7 +158,7 @@ jobs: zig_build: runs-on: ubuntu-20.04 env: - OPENCV_VER: "4.8.0" + OPENCV_VER: "4.9.0" MIX_ENV: prod ZIG_VERSION: "0.8.0" EVISION_PREFER_PRECOMPILED: "false" diff --git a/.github/workflows/linux-precompile-x86_64-manylinux2014-gnu.yml b/.github/workflows/linux-precompile-x86_64-manylinux2014-gnu.yml index 8bec5b09..40d925b8 100644 --- a/.github/workflows/linux-precompile-x86_64-manylinux2014-gnu.yml +++ b/.github/workflows/linux-precompile-x86_64-manylinux2014-gnu.yml @@ -14,7 +14,7 @@ jobs: mix_compile: runs-on: ubuntu-20.04 env: - OPENCV_VER: "4.8.0" + OPENCV_VER: "4.9.0" MIX_ENV: prod EVISION_PREFER_PRECOMPILED: "false" EVISION_GENERATE_LANG: "erlang,elixir" diff --git a/.github/workflows/linux-x86_64.yml b/.github/workflows/linux-x86_64.yml index 188187b0..6be0f83b 100644 --- a/.github/workflows/linux-x86_64.yml +++ b/.github/workflows/linux-x86_64.yml @@ -62,7 +62,7 @@ jobs: container: alpine:latest env: MIX_ENV: test - OPENCV_VER: "4.8.0" + OPENCV_VER: "4.9.0" OTP_VERSION: "25.2" ELIXIR_VERSION: "1.14.3" EVISION_PREFER_PRECOMPILED: "false" @@ -156,7 +156,7 @@ jobs: runs-on: ubuntu-20.04 env: MIX_ENV: test - OPENCV_VER: "4.8.0" + OPENCV_VER: "4.9.0" OTP_VERSION: "25.2" ELIXIR_VERSION: "1.14.3" EVISION_PREFER_PRECOMPILED: "false" diff --git a/.github/workflows/macos-precompile.yml b/.github/workflows/macos-precompile.yml index 3433ce62..694ffe35 100644 --- a/.github/workflows/macos-precompile.yml +++ b/.github/workflows/macos-precompile.yml @@ -14,7 +14,7 @@ jobs: runs-on: macos-11 env: MIX_ENV: prod - OPENCV_VER: "4.8.0" + OPENCV_VER: "4.9.0" EVISION_PREFER_PRECOMPILED: "false" EVISION_GENERATE_LANG: "erlang,elixir" strategy: diff --git a/.github/workflows/macos-x86_64.yml b/.github/workflows/macos-x86_64.yml index 19efa83b..c0afb207 100644 --- a/.github/workflows/macos-x86_64.yml +++ b/.github/workflows/macos-x86_64.yml @@ -47,7 +47,7 @@ jobs: mix_test: runs-on: macos-12 env: - OPENCV_VER: "4.8.0" + OPENCV_VER: "4.9.0" MIX_ENV: "test" EVISION_PREFER_PRECOMPILED: "false" FFMPEG_VER: "5" diff --git a/.github/workflows/nerves-build.yml b/.github/workflows/nerves-build.yml index 63972ac2..b45146c8 100644 --- a/.github/workflows/nerves-build.yml +++ b/.github/workflows/nerves-build.yml @@ -49,7 +49,7 @@ jobs: env: MIX_ENV: prod NERVES_PROJ_NAME: nerves_evision - OPENCV_VER: "4.8.0" + OPENCV_VER: "4.9.0" NERVES_LIVEBOOK_VER: "v0.10.1" ELIXIR_VERSION: "1.15.4" EVISION_PREFER_PRECOMPILED: "false" diff --git a/.github/workflows/test-python-compatibility.yml b/.github/workflows/test-python-compatibility.yml index 92594ac9..51362861 100644 --- a/.github/workflows/test-python-compatibility.yml +++ b/.github/workflows/test-python-compatibility.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-20.04 env: MIX_ENV: test - OPENCV_VER: "4.8.0" + OPENCV_VER: "4.9.0" EVISION_PREFER_PRECOMPILED: "false" strategy: diff --git a/.github/workflows/windows-precompile-cuda.yml b/.github/workflows/windows-precompile-cuda.yml index d058ce7f..a3170af5 100644 --- a/.github/workflows/windows-precompile-cuda.yml +++ b/.github/workflows/windows-precompile-cuda.yml @@ -15,7 +15,7 @@ jobs: runs-on: windows-2019 env: MIX_ENV: prod - OPENCV_VER: "4.8.0" + OPENCV_VER: "4.9.0" ELIXIR_VERSION: "1.15.4" EVISION_PREFER_PRECOMPILED: "false" EVISION_GENERATE_LANG: "erlang,elixir" diff --git a/.github/workflows/windows-precompile.yml b/.github/workflows/windows-precompile.yml index 798b1839..37ce4018 100644 --- a/.github/workflows/windows-precompile.yml +++ b/.github/workflows/windows-precompile.yml @@ -14,7 +14,7 @@ jobs: runs-on: windows-latest env: MIX_ENV: prod - OPENCV_VER: "4.8.0" + OPENCV_VER: "4.9.0" ELIXIR_VERSION: "1.15.4" EVISION_PREFER_PRECOMPILED: "false" EVISION_GENERATE_LANG: "erlang,elixir" diff --git a/.github/workflows/windows-x86_64.yml b/.github/workflows/windows-x86_64.yml index c3429d2f..624e2405 100644 --- a/.github/workflows/windows-x86_64.yml +++ b/.github/workflows/windows-x86_64.yml @@ -49,7 +49,7 @@ jobs: runs-on: windows-latest env: MIX_ENV: test - OPENCV_VER: "4.8.0" + OPENCV_VER: "4.9.0" OTP_VERSION: "25.2" ELIXIR_VERSION: "1.14.3" EVISION_PREFER_PRECOMPILED: "false" diff --git a/Makefile b/Makefile index 9a777bdb..62ee59c1 100644 --- a/Makefile +++ b/Makefile @@ -17,13 +17,13 @@ CMAKE_BUILD_TYPE ?= Release # OpenCV OPENCV_USE_GIT_HEAD ?= false OPENCV_GIT_REPO ?= "https://github.com/opencv/opencv.git" -OPENCV_VER ?= 4.8.0 +OPENCV_VER ?= 4.9.0 ifneq ($(OPENCV_USE_GIT_HEAD), false) OPENCV_VER=$(OPENCV_USE_GIT_BRANCH) endif OPENCV_CONTRIB_USE_GIT_HEAD ?= false OPENCV_CONTRIB_GIT_REPO ?= "https://github.com/opencv/opencv_contrib.git" -OPENCV_CONTRIB_VER ?= 4.8.0 +OPENCV_CONTRIB_VER ?= 4.9.0 ifneq ($(OPENCV_CONTRIB_USE_GIT_HEAD), false) OPENCV_CONTRIB_VER=$(OPENCV_CONTRIB_USE_GIT_BRANCH) endif diff --git a/Makefile.win b/Makefile.win index ec8db965..98a5081a 100644 --- a/Makefile.win +++ b/Makefile.win @@ -21,10 +21,10 @@ OPENCV_USE_GIT_HEAD=false OPENCV_GIT_REPO="https://github.com/opencv/opencv.git" !ENDIF !IFNDEF OPENCV_VER -OPENCV_VER=4.8.0 +OPENCV_VER=4.9.0 !ENDIF !IFNDEF OPENCV_CONTRIB_VER -OPENCV_CONTRIB_VER=4.8.0 +OPENCV_CONTRIB_VER=4.9.0 !ENDIF !IF "$(OPENCV_USE_GIT_HEAD)" == "true" OPENCV_VER=$(OPENCV_USE_GIT_BRANCH) diff --git a/README.md b/README.md index 5ad9b7a3..afea06d0 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ iex> mat = Evision.Mat.from_nx(t) #### Unsupported Type Map -As OpenCV does not support the following types (yet, as of OpenCV 4.8.0) +As OpenCV does not support the following types (yet, as of OpenCV 4.9.0) - `{:s, 64}` - `{:u, 32}` @@ -320,6 +320,7 @@ Compatible OpenCV versions: - 4.6.0 - 4.7.0 - 4.8.0 +- 4.9.0 by compatible, it means these versions can compile successfully, and I tested a small range of functions. Tons of tests should be written, and then we can have a list for tested OpenCV versions. @@ -519,7 +520,7 @@ To obtain and compile OpenCV's source code from official releases, the following # optional ## set OpenCV version ## the corresponding license file should be available at https://github.com/opencv/opencv/blob/${OPENCV_VER}/LICENSE -export OPENCV_VER="4.8.0" +export OPENCV_VER="4.9.0" # optional ## Use Debug build @@ -797,7 +798,7 @@ Say you have the following MIX environment variables: # set by MIX MIX_ENV=dev # set by evision or you -OPENCV_VER=4.8.0 +OPENCV_VER=4.9.0 # set by yourself if you're compiling evision to a nerves firmware MIX_TARGET=rpi4 ``` diff --git a/mix.exs b/mix.exs index 19c04d43..cf592f1a 100644 --- a/mix.exs +++ b/mix.exs @@ -4,9 +4,9 @@ defmodule Evision.MixProject.Metadata do def app, do: :evision def version, do: "0.1.34" def github_url, do: "https://github.com/cocoa-xu/evision" - def opencv_version, do: "4.8.0" + def opencv_version, do: "4.9.0" # only means compatible. need to write more tests - def compatible_opencv_versions, do: ["4.5.3", "4.5.4", "4.5.5", "4.6.0", "4.7.0", "4.8.0"] + def compatible_opencv_versions, do: ["4.5.3", "4.5.4", "4.5.5", "4.6.0", "4.7.0", "4.8.0", "4.9.0"] def default_cuda_version, do: "118" def all_cuda_version, do: ["111", "114", "118"] end diff --git a/patches/apply_patch.py b/patches/apply_patch.py index a0a78a35..cd91e877 100644 --- a/patches/apply_patch.py +++ b/patches/apply_patch.py @@ -10,7 +10,7 @@ def patch_fix_getLayerShapes(opencv_version: str, opencv_src_root: str): - if opencv_version not in ['4.5.4', '4.5.5', '4.6.0', '4.7.0', '4.8.0']: + if opencv_version not in ['4.5.4', '4.5.5', '4.6.0', '4.7.0', '4.8.0', '4.9.0']: print(f"warning: applying `patch_fix_getLayerShapes` to opencv version `{opencv_version}`") # modules/dnn/include/opencv2/dnn/dnn.hpp