Skip to content

Commit e01854e

Browse files
committed
fix version control
1 parent d895492 commit e01854e

File tree

20 files changed

+97
-77
lines changed

20 files changed

+97
-77
lines changed

benchmark/benchmark.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
from utils import METRICS, DATALOADERS
1010

1111
# Check OpenCV version
12-
assert cv.__version__ >= "4.10.0", \
12+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
13+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
1314
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
1415

1516
# Valid combinations of backends and targets

models/face_detection_yunet/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
import numpy as np
1010
import cv2 as cv
1111

12-
from yunet import YuNet
13-
1412
# Check OpenCV version
15-
assert cv.__version__ >= "4.10.0", \
16-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
13+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
14+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
15+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
16+
17+
from yunet import YuNet
1718

1819
# Valid combinations of backends and targets
1920
backend_target_pairs = [

models/face_recognition_sface/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
import numpy as np
1111
import cv2 as cv
1212

13+
# Check OpenCV version
14+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
15+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
16+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
17+
1318
from sface import SFace
1419

1520
sys.path.append('../face_detection_yunet')
1621
from yunet import YuNet
1722

18-
# Check OpenCV version
19-
assert cv.__version__ >= "4.10.0", \
20-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
21-
2223
# Valid combinations of backends and targets
2324
backend_target_pairs = [
2425
[cv.dnn.DNN_BACKEND_OPENCV, cv.dnn.DNN_TARGET_CPU],

models/facial_expression_recognition/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@
66
import numpy as np
77
import cv2 as cv
88

9+
# Check OpenCV version
10+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
11+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
12+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
13+
914
from facial_fer_model import FacialExpressionRecog
1015

1116
sys.path.append('../face_detection_yunet')
1217
from yunet import YuNet
1318

14-
# Check OpenCV version
15-
assert cv.__version__ >= "4.10.0", \
16-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
17-
1819
# Valid combinations of backends and targets
1920
backend_target_pairs = [
2021
[cv.dnn.DNN_BACKEND_OPENCV, cv.dnn.DNN_TARGET_CPU],

models/handpose_estimation_mediapipe/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44
import numpy as np
55
import cv2 as cv
66

7+
# Check OpenCV version
8+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
9+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
10+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
11+
712
from mp_handpose import MPHandPose
813

914
sys.path.append('../palm_detection_mediapipe')
1015
from mp_palmdet import MPPalmDet
1116

12-
# Check OpenCV version
13-
assert cv.__version__ >= "4.10.0", \
14-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
15-
1617
# Valid combinations of backends and targets
1718
backend_target_pairs = [
1819
[cv.dnn.DNN_BACKEND_OPENCV, cv.dnn.DNN_TARGET_CPU],

models/human_segmentation_pphumanseg/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
import numpy as np
1010
import cv2 as cv
1111

12-
from pphumanseg import PPHumanSeg
13-
1412
# Check OpenCV version
15-
assert cv.__version__ >= "4.10.0", \
16-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
13+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
14+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
15+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
16+
17+
from pphumanseg import PPHumanSeg
1718

1819
# Valid combinations of backends and targets
1920
backend_target_pairs = [

models/image_classification_mobilenet/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
import numpy as np
44
import cv2 as cv
55

6-
from mobilenet import MobileNet
7-
86
# Check OpenCV version
9-
assert cv.__version__ >= "4.10.0", \
10-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
7+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
8+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
9+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
10+
11+
from mobilenet import MobileNet
1112

1213
# Valid combinations of backends and targets
1314
backend_target_pairs = [

models/image_classification_ppresnet/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
import numpy as np
1010
import cv2 as cv
1111

12-
from ppresnet import PPResNet
13-
1412
# Check OpenCV version
15-
assert cv.__version__ >= "4.10.0", \
16-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
13+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
14+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
15+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
16+
17+
from ppresnet import PPResNet
1718

1819
# Valid combinations of backends and targets
1920
backend_target_pairs = [

models/license_plate_detection_yunet/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
import numpy as np
44
import cv2 as cv
55

6-
from lpd_yunet import LPD_YuNet
7-
86
# Check OpenCV version
9-
assert cv.__version__ >= "4.10.0", \
10-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
7+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
8+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
9+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
10+
11+
from lpd_yunet import LPD_YuNet
1112

1213
# Valid combinations of backends and targets
1314
backend_target_pairs = [

models/object_detection_nanodet/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
import cv2 as cv
33
import argparse
44

5-
from nanodet import NanoDet
6-
75
# Check OpenCV version
8-
assert cv.__version__ >= "4.10.0", \
9-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
6+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
7+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
8+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
9+
10+
from nanodet import NanoDet
1011

1112
# Valid combinations of backends and targets
1213
backend_target_pairs = [

models/object_detection_yolox/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
import cv2 as cv
33
import argparse
44

5-
from yolox import YoloX
6-
75
# Check OpenCV version
8-
assert cv.__version__ >= "4.10.0", \
9-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
6+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
7+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
8+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
9+
10+
from yolox import YoloX
1011

1112
# Valid combinations of backends and targets
1213
backend_target_pairs = [

models/object_tracking_vittrack/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
import numpy as np
77
import cv2 as cv
88

9-
from vittrack import VitTrack
10-
119
# Check OpenCV version
12-
assert cv.__version__ >= "4.10.0", \
13-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
10+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
11+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
12+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
13+
14+
from vittrack import VitTrack
1415

1516
# Valid combinations of backends and targets
1617
backend_target_pairs = [

models/optical_flow_estimation_raft/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
import cv2 as cv
44
import numpy as np
55

6-
from raft import Raft
7-
86
# Check OpenCV version
9-
assert cv.__version__ >= "4.10.0", \
10-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
7+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
8+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
9+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
10+
11+
from raft import Raft
1112

1213
parser = argparse.ArgumentParser(description='RAFT (https://github.com/princeton-vl/RAFT)')
1314
parser.add_argument('--input1', '-i1', type=str,

models/palm_detection_mediapipe/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
import numpy as np
44
import cv2 as cv
55

6-
from mp_palmdet import MPPalmDet
7-
86
# Check OpenCV version
9-
assert cv.__version__ >= "4.10.0", \
10-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
7+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
8+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
9+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
10+
11+
from mp_palmdet import MPPalmDet
1112

1213
# Valid combinations of backends and targets
1314
backend_target_pairs = [

models/person_detection_mediapipe/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
import numpy as np
44
import cv2 as cv
55

6-
from mp_persondet import MPPersonDet
7-
86
# Check OpenCV version
9-
assert cv.__version__ >= "4.10.0", \
10-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
7+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
8+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
9+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
10+
11+
from mp_persondet import MPPersonDet
1112

1213
# Valid combinations of backends and targets
1314
backend_target_pairs = [

models/person_reid_youtureid/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
import numpy as np
1111
import cv2 as cv
1212

13-
from youtureid import YoutuReID
14-
1513
# Check OpenCV version
16-
assert cv.__version__ >= "4.10.0", \
17-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
14+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
15+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
16+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
17+
18+
from youtureid import YoutuReID
1819

1920
# Valid combinations of backends and targets
2021
backend_target_pairs = [

models/pose_estimation_mediapipe/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44
import numpy as np
55
import cv2 as cv
66

7+
# Check OpenCV version
8+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
9+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
10+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
11+
712
from mp_pose import MPPose
813

914
sys.path.append('../person_detection_mediapipe')
1015
from mp_persondet import MPPersonDet
1116

12-
# Check OpenCV version
13-
assert cv.__version__ >= "4.10.0", \
14-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
15-
1617
# Valid combinations of backends and targets
1718
backend_target_pairs = [
1819
[cv.dnn.DNN_BACKEND_OPENCV, cv.dnn.DNN_TARGET_CPU],

models/qrcode_wechatqrcode/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
import numpy as np
1010
import cv2 as cv
1111

12-
from wechatqrcode import WeChatQRCode
13-
1412
# Check OpenCV version
15-
assert cv.__version__ >= "4.10.0", \
16-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
13+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
14+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
15+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
16+
17+
from wechatqrcode import WeChatQRCode
1718

1819
# Valid combinations of backends and targets
1920
backend_target_pairs = [

models/text_detection_ppocr/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
import numpy as np
1010
import cv2 as cv
1111

12-
from ppocr_det import PPOCRDet
13-
1412
# Check OpenCV version
15-
assert cv.__version__ >= "4.10.0", \
16-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
13+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
14+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
15+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
16+
17+
from ppocr_det import PPOCRDet
1718

1819
# Valid combinations of backends and targets
1920
backend_target_pairs = [

models/text_recognition_crnn/demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
import numpy as np
1111
import cv2 as cv
1212

13+
# Check OpenCV version
14+
opencv_python_version = lambda str_version: tuple(map(int, (str_version.split("."))))
15+
assert opencv_python_version(cv.__version__) >= opencv_python_version("4.10.0"), \
16+
"Please install latest opencv-python for benchmark: python3 -m pip install --upgrade opencv-python"
17+
1318
from crnn import CRNN
1419

1520
sys.path.append('../text_detection_ppocr')
1621
from ppocr_det import PPOCRDet
1722

18-
# Check OpenCV version
19-
assert cv.__version__ >= "4.10.0", \
20-
"Please install latest opencv-python to try this demo: python3 -m pip install --upgrade opencv-python"
21-
2223
# Valid combinations of backends and targets
2324
backend_target_pairs = [
2425
[cv.dnn.DNN_BACKEND_OPENCV, cv.dnn.DNN_TARGET_CPU],

0 commit comments

Comments
 (0)