From db567b5f62a101ff81d07b95e0926fed22e9f11a Mon Sep 17 00:00:00 2001 From: Wang Xin Date: Mon, 17 Jun 2024 21:58:12 +0800 Subject: [PATCH 1/2] fix opencv import error for numpy 2.0 --- .github/workflows/tests.yaml | 2 +- pyproject.toml | 6 +++--- requirements.txt | 8 +++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 24eb722f57..3554bdee15 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -23,7 +23,7 @@ jobs: python -m pip install --upgrade pip pip install pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - pip install "paddlepaddle==2.5" + pip install paddlepaddle==0.0.0 -f https://www.paddlepaddle.org.cn/whl/linux/cpu-mkl/develop.html pip install -e . - name: Test with pytest run: | diff --git a/pyproject.toml b/pyproject.toml index fc07b2d8df..f4a019fd80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,10 +47,10 @@ dependencies = [ "tqdm", "numpy", "rapidfuzz", - "opencv-python<=4.6.0.66", - "opencv-contrib-python<=4.6.0.66", + "opencv-python", + "opencv-contrib-python", "cython", - "Pillow>=10.0.0", + "Pillow", "pyyaml", "python-docx", "beautifulsoup4", diff --git a/requirements.txt b/requirements.txt index 56856c5c54..15b2b3bd91 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,9 +6,11 @@ lmdb tqdm numpy rapidfuzz -opencv-python<=4.6.0.66 -opencv-contrib-python<=4.6.0.66 +opencv-python +opencv-contrib-python cython -Pillow>=10.0.0 +Pillow pyyaml requests +--no-binary=opencv-python +--no-binary=opencv-contrib-python From af1b1422269ebdd8fc4395ca4e2bbeb899862497 Mon Sep 17 00:00:00 2001 From: Wang Xin Date: Mon, 17 Jun 2024 23:22:27 +0800 Subject: [PATCH 2/2] update requirements.txt --- requirements.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 15b2b3bd91..00cc4bffed 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,5 +12,3 @@ cython Pillow pyyaml requests ---no-binary=opencv-python ---no-binary=opencv-contrib-python