From f88e9b2bafd21f1cad242fb5af6d78f2bcba16a3 Mon Sep 17 00:00:00 2001 From: Yuantao Feng Date: Tue, 4 Jun 2024 16:13:28 +0800 Subject: [PATCH] bump opencv version to 4.10.0 (#260) * bump opencv version to 4.10.0 * doc: version change * fix version control * fix version control for efficient sam --- benchmark/README.md | 2 +- benchmark/benchmark.py | 3 ++- models/face_detection_yunet/CMakeLists.txt | 2 +- models/face_detection_yunet/demo.py | 9 +++++---- models/face_recognition_sface/demo.py | 9 +++++---- models/facial_expression_recognition/CMakeLists.txt | 2 +- models/facial_expression_recognition/demo.py | 9 +++++---- models/handpose_estimation_mediapipe/demo.py | 9 +++++---- models/human_segmentation_pphumanseg/CMakeLists.txt | 2 +- models/human_segmentation_pphumanseg/demo.py | 9 +++++---- models/image_classification_mobilenet/CMakeLists.txt | 2 +- models/image_classification_mobilenet/demo.py | 9 +++++---- models/image_classification_ppresnet/CMakeLists.txt | 2 +- models/image_classification_ppresnet/demo.py | 9 +++++---- models/image_segmentation_efficientsam/demo.py | 5 +++-- models/license_plate_detection_yunet/demo.py | 9 +++++---- models/object_detection_nanodet/CMakeLists.txt | 2 +- models/object_detection_nanodet/demo.py | 9 +++++---- models/object_detection_yolox/CMakeLists.txt | 2 +- models/object_detection_yolox/demo.py | 9 +++++---- models/object_tracking_vittrack/CMakeLists.txt | 2 +- models/object_tracking_vittrack/demo.py | 9 +++++---- models/optical_flow_estimation_raft/demo.py | 9 +++++---- models/palm_detection_mediapipe/demo.py | 9 +++++---- models/person_detection_mediapipe/CMakeLists.txt | 2 +- models/person_detection_mediapipe/demo.py | 9 +++++---- models/person_reid_youtureid/demo.py | 9 +++++---- models/pose_estimation_mediapipe/CMakeLists.txt | 2 +- models/pose_estimation_mediapipe/demo.py | 9 +++++---- models/qrcode_wechatqrcode/demo.py | 9 +++++---- models/text_detection_ppocr/CMakeLists.txt | 2 +- models/text_detection_ppocr/demo.py | 9 +++++---- models/text_recognition_crnn/CMakeLists.txt | 2 +- models/text_recognition_crnn/demo.py | 9 +++++---- tools/quantize/requirements.txt | 2 +- 35 files changed, 114 insertions(+), 93 deletions(-) diff --git a/benchmark/README.md b/benchmark/README.md index 52a23557..30b6d381 100644 --- a/benchmark/README.md +++ b/benchmark/README.md @@ -55,7 +55,7 @@ python benchmark.py --all --cfg_overwrite_backend_target 1 ## Detailed Results -Benchmark is done with latest `opencv-python==4.8.0.74` and `opencv-contrib-python==4.8.0.74` on the following platforms. Some models are excluded because of support issues. +Benchmark is done with latest opencv-python & opencv-contrib-python (current 4.10.0) on the following platforms. Some models are excluded because of support issues. ### Intel 12700K diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index 35320b0a..67a8f24c 100644 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -9,7 +9,8 @@ from utils import METRICS, DATALOADERS # Check OpenCV version -assert cv.__version__ >= "4.9.0", \ +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" # Valid combinations of backends and targets diff --git a/models/face_detection_yunet/CMakeLists.txt b/models/face_detection_yunet/CMakeLists.txt index 1caebdae..68ebadcd 100644 --- a/models/face_detection_yunet/CMakeLists.txt +++ b/models/face_detection_yunet/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24.0) project(opencv_zoo_face_detection_yunet) -set(OPENCV_VERSION "4.9.0") +set(OPENCV_VERSION "4.10.0") set(OPENCV_INSTALLATION_PATH "" CACHE PATH "Where to look for OpenCV installation") # Find OpenCV diff --git a/models/face_detection_yunet/demo.py b/models/face_detection_yunet/demo.py index 68f4396c..d33a9db5 100644 --- a/models/face_detection_yunet/demo.py +++ b/models/face_detection_yunet/demo.py @@ -9,11 +9,12 @@ import numpy as np import cv2 as cv -from yunet import YuNet - # Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + +from yunet import YuNet # Valid combinations of backends and targets backend_target_pairs = [ diff --git a/models/face_recognition_sface/demo.py b/models/face_recognition_sface/demo.py index 248b9df1..c3054b14 100644 --- a/models/face_recognition_sface/demo.py +++ b/models/face_recognition_sface/demo.py @@ -10,15 +10,16 @@ import numpy as np import cv2 as cv +# Check OpenCV version +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + from sface import SFace sys.path.append('../face_detection_yunet') from yunet import YuNet -# Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" - # Valid combinations of backends and targets backend_target_pairs = [ [cv.dnn.DNN_BACKEND_OPENCV, cv.dnn.DNN_TARGET_CPU], diff --git a/models/facial_expression_recognition/CMakeLists.txt b/models/facial_expression_recognition/CMakeLists.txt index 7a138782..5004f437 100644 --- a/models/facial_expression_recognition/CMakeLists.txt +++ b/models/facial_expression_recognition/CMakeLists.txt @@ -4,7 +4,7 @@ set(project_name "opencv_zoo_face_expression_recognition") PROJECT (${project_name}) -set(OPENCV_VERSION "4.9.0") +set(OPENCV_VERSION "4.10.0") set(OPENCV_INSTALLATION_PATH "" CACHE PATH "Where to look for OpenCV installation") find_package(OpenCV ${OPENCV_VERSION} REQUIRED HINTS ${OPENCV_INSTALLATION_PATH}) # Find OpenCV, you may need to set OpenCV_DIR variable diff --git a/models/facial_expression_recognition/demo.py b/models/facial_expression_recognition/demo.py index a43af6c4..3b273928 100644 --- a/models/facial_expression_recognition/demo.py +++ b/models/facial_expression_recognition/demo.py @@ -6,15 +6,16 @@ import numpy as np import cv2 as cv +# Check OpenCV version +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + from facial_fer_model import FacialExpressionRecog sys.path.append('../face_detection_yunet') from yunet import YuNet -# Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" - # Valid combinations of backends and targets backend_target_pairs = [ [cv.dnn.DNN_BACKEND_OPENCV, cv.dnn.DNN_TARGET_CPU], diff --git a/models/handpose_estimation_mediapipe/demo.py b/models/handpose_estimation_mediapipe/demo.py index 34460e26..37c3cf03 100644 --- a/models/handpose_estimation_mediapipe/demo.py +++ b/models/handpose_estimation_mediapipe/demo.py @@ -4,15 +4,16 @@ import numpy as np import cv2 as cv +# Check OpenCV version +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + from mp_handpose import MPHandPose sys.path.append('../palm_detection_mediapipe') from mp_palmdet import MPPalmDet -# Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" - # Valid combinations of backends and targets backend_target_pairs = [ [cv.dnn.DNN_BACKEND_OPENCV, cv.dnn.DNN_TARGET_CPU], diff --git a/models/human_segmentation_pphumanseg/CMakeLists.txt b/models/human_segmentation_pphumanseg/CMakeLists.txt index a04ec3e3..95aec537 100644 --- a/models/human_segmentation_pphumanseg/CMakeLists.txt +++ b/models/human_segmentation_pphumanseg/CMakeLists.txt @@ -4,7 +4,7 @@ set(project_name "opencv_zoo_human_segmentation") PROJECT (${project_name}) -set(OPENCV_VERSION "4.9.0") +set(OPENCV_VERSION "4.10.0") set(OPENCV_INSTALLATION_PATH "" CACHE PATH "Where to look for OpenCV installation") find_package(OpenCV ${OPENCV_VERSION} REQUIRED HINTS ${OPENCV_INSTALLATION_PATH}) # Find OpenCV, you may need to set OpenCV_DIR variable diff --git a/models/human_segmentation_pphumanseg/demo.py b/models/human_segmentation_pphumanseg/demo.py index 313f320c..df28f570 100644 --- a/models/human_segmentation_pphumanseg/demo.py +++ b/models/human_segmentation_pphumanseg/demo.py @@ -9,11 +9,12 @@ import numpy as np import cv2 as cv -from pphumanseg import PPHumanSeg - # Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + +from pphumanseg import PPHumanSeg # Valid combinations of backends and targets backend_target_pairs = [ diff --git a/models/image_classification_mobilenet/CMakeLists.txt b/models/image_classification_mobilenet/CMakeLists.txt index 681e43c2..b4005c04 100644 --- a/models/image_classification_mobilenet/CMakeLists.txt +++ b/models/image_classification_mobilenet/CMakeLists.txt @@ -3,7 +3,7 @@ set(project_name "opencv_zoo_image_classification_mobilenet") PROJECT (${project_name}) -set(OPENCV_VERSION "4.9.0") +set(OPENCV_VERSION "4.10.0") set(OPENCV_INSTALLATION_PATH "" CACHE PATH "Where to look for OpenCV installation") find_package(OpenCV ${OPENCV_VERSION} REQUIRED HINTS ${OPENCV_INSTALLATION_PATH}) # Find OpenCV, you may need to set OpenCV_DIR variable diff --git a/models/image_classification_mobilenet/demo.py b/models/image_classification_mobilenet/demo.py index efbbc8b4..4aa990af 100644 --- a/models/image_classification_mobilenet/demo.py +++ b/models/image_classification_mobilenet/demo.py @@ -3,11 +3,12 @@ import numpy as np import cv2 as cv -from mobilenet import MobileNet - # Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + +from mobilenet import MobileNet # Valid combinations of backends and targets backend_target_pairs = [ diff --git a/models/image_classification_ppresnet/CMakeLists.txt b/models/image_classification_ppresnet/CMakeLists.txt index 98e8df07..9707d1e6 100644 --- a/models/image_classification_ppresnet/CMakeLists.txt +++ b/models/image_classification_ppresnet/CMakeLists.txt @@ -3,7 +3,7 @@ set(project_name "opencv_zoo_image_classification_ppresnet") PROJECT (${project_name}) -set(OPENCV_VERSION "4.9.0") +set(OPENCV_VERSION "4.10.0") set(OPENCV_INSTALLATION_PATH "" CACHE PATH "Where to look for OpenCV installation") find_package(OpenCV ${OPENCV_VERSION} REQUIRED HINTS ${OPENCV_INSTALLATION_PATH}) # Find OpenCV, you may need to set OpenCV_DIR variable diff --git a/models/image_classification_ppresnet/demo.py b/models/image_classification_ppresnet/demo.py index 606cc5a3..8157f26f 100644 --- a/models/image_classification_ppresnet/demo.py +++ b/models/image_classification_ppresnet/demo.py @@ -9,11 +9,12 @@ import numpy as np import cv2 as cv -from ppresnet import PPResNet - # Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + +from ppresnet import PPResNet # Valid combinations of backends and targets backend_target_pairs = [ diff --git a/models/image_segmentation_efficientsam/demo.py b/models/image_segmentation_efficientsam/demo.py index 89f36093..2dc0084c 100644 --- a/models/image_segmentation_efficientsam/demo.py +++ b/models/image_segmentation_efficientsam/demo.py @@ -4,8 +4,9 @@ from efficientSAM import EfficientSAM # Check OpenCV version -assert cv.__version__ >= "4.10.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" # Valid combinations of backends and targets backend_target_pairs = [ diff --git a/models/license_plate_detection_yunet/demo.py b/models/license_plate_detection_yunet/demo.py index f19a4c0c..066b63a4 100644 --- a/models/license_plate_detection_yunet/demo.py +++ b/models/license_plate_detection_yunet/demo.py @@ -3,11 +3,12 @@ import numpy as np import cv2 as cv -from lpd_yunet import LPD_YuNet - # Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + +from lpd_yunet import LPD_YuNet # Valid combinations of backends and targets backend_target_pairs = [ diff --git a/models/object_detection_nanodet/CMakeLists.txt b/models/object_detection_nanodet/CMakeLists.txt index cebba4d0..332f487d 100644 --- a/models/object_detection_nanodet/CMakeLists.txt +++ b/models/object_detection_nanodet/CMakeLists.txt @@ -3,7 +3,7 @@ set(project_name "opencv_zoo_object_detection_nanodet") PROJECT (${project_name}) -set(OPENCV_VERSION "4.9.0") +set(OPENCV_VERSION "4.10.0") set(OPENCV_INSTALLATION_PATH "" CACHE PATH "Where to look for OpenCV installation") find_package(OpenCV ${OPENCV_VERSION} REQUIRED HINTS ${OPENCV_INSTALLATION_PATH}) # Find OpenCV, you may need to set OpenCV_DIR variable diff --git a/models/object_detection_nanodet/demo.py b/models/object_detection_nanodet/demo.py index b1971670..ab6e980a 100644 --- a/models/object_detection_nanodet/demo.py +++ b/models/object_detection_nanodet/demo.py @@ -2,11 +2,12 @@ import cv2 as cv import argparse -from nanodet import NanoDet - # Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + +from nanodet import NanoDet # Valid combinations of backends and targets backend_target_pairs = [ diff --git a/models/object_detection_yolox/CMakeLists.txt b/models/object_detection_yolox/CMakeLists.txt index 426f76f7..5c373e40 100644 --- a/models/object_detection_yolox/CMakeLists.txt +++ b/models/object_detection_yolox/CMakeLists.txt @@ -3,7 +3,7 @@ set(project_name "opencv_zoo_object_detection_yolox") PROJECT (${project_name}) -set(OPENCV_VERSION "4.9.0") +set(OPENCV_VERSION "4.10.0") set(OPENCV_INSTALLATION_PATH "" CACHE PATH "Where to look for OpenCV installation") find_package(OpenCV ${OPENCV_VERSION} REQUIRED HINTS ${OPENCV_INSTALLATION_PATH}) # Find OpenCV, you may need to set OpenCV_DIR variable diff --git a/models/object_detection_yolox/demo.py b/models/object_detection_yolox/demo.py index 099b701b..a854f13f 100644 --- a/models/object_detection_yolox/demo.py +++ b/models/object_detection_yolox/demo.py @@ -2,11 +2,12 @@ import cv2 as cv import argparse -from yolox import YoloX - # Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + +from yolox import YoloX # Valid combinations of backends and targets backend_target_pairs = [ diff --git a/models/object_tracking_vittrack/CMakeLists.txt b/models/object_tracking_vittrack/CMakeLists.txt index cf20b70e..51644e83 100644 --- a/models/object_tracking_vittrack/CMakeLists.txt +++ b/models/object_tracking_vittrack/CMakeLists.txt @@ -3,7 +3,7 @@ set(project_name "opencv_zoo_object_tracking_vittrack") PROJECT (${project_name}) -set(OPENCV_VERSION "4.9.0") +set(OPENCV_VERSION "4.10.0") set(OPENCV_INSTALLATION_PATH "" CACHE PATH "Where to look for OpenCV installation") find_package(OpenCV ${OPENCV_VERSION} REQUIRED HINTS ${OPENCV_INSTALLATION_PATH}) # Find OpenCV, you may need to set OpenCV_DIR variable diff --git a/models/object_tracking_vittrack/demo.py b/models/object_tracking_vittrack/demo.py index 0111126f..21d65878 100644 --- a/models/object_tracking_vittrack/demo.py +++ b/models/object_tracking_vittrack/demo.py @@ -6,11 +6,12 @@ import numpy as np import cv2 as cv -from vittrack import VitTrack - # Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + +from vittrack import VitTrack # Valid combinations of backends and targets backend_target_pairs = [ diff --git a/models/optical_flow_estimation_raft/demo.py b/models/optical_flow_estimation_raft/demo.py index f6a67218..821be26c 100644 --- a/models/optical_flow_estimation_raft/demo.py +++ b/models/optical_flow_estimation_raft/demo.py @@ -3,11 +3,12 @@ import cv2 as cv import numpy as np -from raft import Raft - # Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + +from raft import Raft parser = argparse.ArgumentParser(description='RAFT (https://github.com/princeton-vl/RAFT)') parser.add_argument('--input1', '-i1', type=str, diff --git a/models/palm_detection_mediapipe/demo.py b/models/palm_detection_mediapipe/demo.py index a1a49b57..98fdf694 100644 --- a/models/palm_detection_mediapipe/demo.py +++ b/models/palm_detection_mediapipe/demo.py @@ -3,11 +3,12 @@ import numpy as np import cv2 as cv -from mp_palmdet import MPPalmDet - # Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + +from mp_palmdet import MPPalmDet # Valid combinations of backends and targets backend_target_pairs = [ diff --git a/models/person_detection_mediapipe/CMakeLists.txt b/models/person_detection_mediapipe/CMakeLists.txt index 84cf3701..e3f4b051 100644 --- a/models/person_detection_mediapipe/CMakeLists.txt +++ b/models/person_detection_mediapipe/CMakeLists.txt @@ -3,7 +3,7 @@ set(project_name "opencv_zoo_person_detection_mediapipe") PROJECT (${project_name}) -set(OPENCV_VERSION "4.9.0") +set(OPENCV_VERSION "4.10.0") set(OPENCV_INSTALLATION_PATH "" CACHE PATH "Where to look for OpenCV installation") find_package(OpenCV ${OPENCV_VERSION} REQUIRED HINTS ${OPENCV_INSTALLATION_PATH}) # Find OpenCV, you may need to set OpenCV_DIR variable diff --git a/models/person_detection_mediapipe/demo.py b/models/person_detection_mediapipe/demo.py index 851bf0ff..d7791423 100644 --- a/models/person_detection_mediapipe/demo.py +++ b/models/person_detection_mediapipe/demo.py @@ -3,11 +3,12 @@ import numpy as np import cv2 as cv -from mp_persondet import MPPersonDet - # Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + +from mp_persondet import MPPersonDet # Valid combinations of backends and targets backend_target_pairs = [ diff --git a/models/person_reid_youtureid/demo.py b/models/person_reid_youtureid/demo.py index 61900e3f..5160b918 100644 --- a/models/person_reid_youtureid/demo.py +++ b/models/person_reid_youtureid/demo.py @@ -10,11 +10,12 @@ import numpy as np import cv2 as cv -from youtureid import YoutuReID - # Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + +from youtureid import YoutuReID # Valid combinations of backends and targets backend_target_pairs = [ diff --git a/models/pose_estimation_mediapipe/CMakeLists.txt b/models/pose_estimation_mediapipe/CMakeLists.txt index b221a827..e49645ac 100644 --- a/models/pose_estimation_mediapipe/CMakeLists.txt +++ b/models/pose_estimation_mediapipe/CMakeLists.txt @@ -3,7 +3,7 @@ set(project_name "opencv_zoo_pose_estimation_mediapipe") PROJECT (${project_name}) -set(OPENCV_VERSION "4.9.0") +set(OPENCV_VERSION "4.10.0") set(OPENCV_INSTALLATION_PATH "" CACHE PATH "Where to look for OpenCV installation") find_package(OpenCV ${OPENCV_VERSION} REQUIRED HINTS ${OPENCV_INSTALLATION_PATH}) # Find OpenCV, you may need to set OpenCV_DIR variable diff --git a/models/pose_estimation_mediapipe/demo.py b/models/pose_estimation_mediapipe/demo.py index cdda151f..4b70a1e0 100644 --- a/models/pose_estimation_mediapipe/demo.py +++ b/models/pose_estimation_mediapipe/demo.py @@ -4,15 +4,16 @@ import numpy as np import cv2 as cv +# Check OpenCV version +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + from mp_pose import MPPose sys.path.append('../person_detection_mediapipe') from mp_persondet import MPPersonDet -# Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" - # Valid combinations of backends and targets backend_target_pairs = [ [cv.dnn.DNN_BACKEND_OPENCV, cv.dnn.DNN_TARGET_CPU], diff --git a/models/qrcode_wechatqrcode/demo.py b/models/qrcode_wechatqrcode/demo.py index 005e0d59..2cd08b56 100644 --- a/models/qrcode_wechatqrcode/demo.py +++ b/models/qrcode_wechatqrcode/demo.py @@ -9,11 +9,12 @@ import numpy as np import cv2 as cv -from wechatqrcode import WeChatQRCode - # Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + +from wechatqrcode import WeChatQRCode # Valid combinations of backends and targets backend_target_pairs = [ diff --git a/models/text_detection_ppocr/CMakeLists.txt b/models/text_detection_ppocr/CMakeLists.txt index a384a3eb..9f56acaa 100644 --- a/models/text_detection_ppocr/CMakeLists.txt +++ b/models/text_detection_ppocr/CMakeLists.txt @@ -3,7 +3,7 @@ set(project_name "opencv_zoo_text_detection_ppocr") PROJECT (${project_name}) -set(OPENCV_VERSION "4.9.0") +set(OPENCV_VERSION "4.10.0") set(OPENCV_INSTALLATION_PATH "" CACHE PATH "Where to look for OpenCV installation") find_package(OpenCV ${OPENCV_VERSION} REQUIRED HINTS ${OPENCV_INSTALLATION_PATH}) # Find OpenCV, you may need to set OpenCV_DIR variable diff --git a/models/text_detection_ppocr/demo.py b/models/text_detection_ppocr/demo.py index 3a31c146..18a5efaa 100644 --- a/models/text_detection_ppocr/demo.py +++ b/models/text_detection_ppocr/demo.py @@ -9,11 +9,12 @@ import numpy as np import cv2 as cv -from ppocr_det import PPOCRDet - # Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + +from ppocr_det import PPOCRDet # Valid combinations of backends and targets backend_target_pairs = [ diff --git a/models/text_recognition_crnn/CMakeLists.txt b/models/text_recognition_crnn/CMakeLists.txt index d3ddd496..15a73813 100644 --- a/models/text_recognition_crnn/CMakeLists.txt +++ b/models/text_recognition_crnn/CMakeLists.txt @@ -3,7 +3,7 @@ set(project_name "opencv_zoo_text_recognition_crnn") PROJECT (${project_name}) -set(OPENCV_VERSION "4.9.0") +set(OPENCV_VERSION "4.10.0") set(OPENCV_INSTALLATION_PATH "" CACHE PATH "Where to look for OpenCV installation") find_package(OpenCV ${OPENCV_VERSION} REQUIRED HINTS ${OPENCV_INSTALLATION_PATH}) # Find OpenCV, you may need to set OpenCV_DIR variable diff --git a/models/text_recognition_crnn/demo.py b/models/text_recognition_crnn/demo.py index b409833b..02ba036f 100644 --- a/models/text_recognition_crnn/demo.py +++ b/models/text_recognition_crnn/demo.py @@ -10,15 +10,16 @@ import numpy as np import cv2 as cv +# Check OpenCV version +opencv_python_version = lambda str_version: tuple(map(int, (str_version.split(".")))) +assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \ + "Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python" + from crnn import CRNN sys.path.append('../text_detection_ppocr') from ppocr_det import PPOCRDet -# Check OpenCV version -assert cv.__version__ >= "4.9.0", \ - "Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python" - # Valid combinations of backends and targets backend_target_pairs = [ [cv.dnn.DNN_BACKEND_OPENCV, cv.dnn.DNN_TARGET_CPU], diff --git a/tools/quantize/requirements.txt b/tools/quantize/requirements.txt index 0fac9c77..3589a8f4 100644 --- a/tools/quantize/requirements.txt +++ b/tools/quantize/requirements.txt @@ -1,4 +1,4 @@ -opencv-python>=4.9.0 +opencv-python>=4.10.0 onnx onnxruntime onnxruntime-extensions