mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Merge pull request #19982 from TolyaTalamanov:at/new-python-operation-api
G-API: New python operations API * Reimplement test using decorators * Custom python operation API * Remove wip status * python: support Python code in bindings (through loader only) * cleanup, skip tests for Python 2.x (not supported) * python 2.x can't skip unittest modules * Clean up * Clean up * Fix segfault python3.9 Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
This commit is contained in:
committed by
GitHub
parent
0f11b1fc0d
commit
c4df8989e9
@@ -4,6 +4,8 @@ OpenCV Python binary extension loader
|
||||
import os
|
||||
import sys
|
||||
|
||||
__all__ = []
|
||||
|
||||
try:
|
||||
import numpy
|
||||
import numpy.core.multiarray
|
||||
@@ -13,6 +15,14 @@ except ImportError:
|
||||
print(' pip install numpy')
|
||||
raise
|
||||
|
||||
|
||||
py_code_loader = None
|
||||
if sys.version_info[:2] >= (3, 0):
|
||||
try:
|
||||
from . import _extra_py_code as py_code_loader
|
||||
except:
|
||||
pass
|
||||
|
||||
# TODO
|
||||
# is_x64 = sys.maxsize > 2**32
|
||||
|
||||
@@ -97,6 +107,11 @@ def bootstrap():
|
||||
except:
|
||||
pass
|
||||
|
||||
if DEBUG: print('OpenCV loader: binary extension... OK')
|
||||
|
||||
if py_code_loader:
|
||||
py_code_loader.init('cv2')
|
||||
|
||||
if DEBUG: print('OpenCV loader: DONE')
|
||||
|
||||
bootstrap()
|
||||
|
||||
Reference in New Issue
Block a user