Skip to content

Commit be73fbc

Browse files
Merge pull request #938 from luxonis/fix/cv2_cond_import
Fix cv2 import
2 parents 32879ee + 22192e7 commit be73fbc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

depthai_sdk/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name='depthai-sdk',
12-
version='1.9.4',
12+
version='1.9.4.1',
1313
description='This package provides an abstraction of the DepthAI API library.',
1414
long_description=io.open("README.md", encoding="utf-8").read(),
1515
long_description_content_type="text/markdown",

depthai_sdk/src/depthai_sdk/previews.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
import math
33
from functools import partial
44

5-
import cv2
65
import numpy as np
76

7+
try:
8+
import cv2
9+
except ImportError:
10+
cv2 = None
11+
812
try:
913
from turbojpeg import TurboJPEG, TJFLAG_FASTUPSAMPLE, TJFLAG_FASTDCT, TJPF_GRAY
1014
turbo = TurboJPEG()

0 commit comments

Comments
 (0)