Skip to content

Commit 2b4dbdd

Browse files
opencv should be optional
only needed in some cases, heavy requirement to put here
1 parent a72a041 commit 2b4dbdd

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

sdk/diffgram/brain/brain.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
import tempfile
55

66
# TODO import these only if local prediction is needed
7-
import cv2
7+
8+
try:
9+
import cv2
10+
except:
11+
print("Could not import cv2")
812

913
try:
1014
import tensorflow as tf

sdk/setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import setuptools
22
import diffgram.__init__ as init
33

4-
with open(".././README.md", "r") as fh:
5-
long_description = fh.read()
4+
try:
5+
with open(".././README.md", "r") as fh:
6+
long_description = fh.read()
7+
except:
8+
long_description = "None"
69

710
setuptools.setup(
811
name = init.__name__,
@@ -22,7 +25,6 @@
2225
],
2326
install_requires=[
2427
'requests>=2.20.1',
25-
'opencv-python>=4.0.0.21',
2628
'scipy>=1.1.0',
2729
'six>=1.9.0',
2830
'pillow>=6.1.0',

0 commit comments

Comments
 (0)