fix: opencv在启动时不import
This commit is contained in:
parent
0870b13ea3
commit
a9b81849b2
|
@ -11,7 +11,7 @@ from . import BeiHangGrpc_pb2_grpc
|
|||
from . import BeiHangGrpc_pb2
|
||||
import uuid
|
||||
from django.conf import settings
|
||||
import cv2
|
||||
|
||||
requests.packages.urllib3.disable_warnings()
|
||||
|
||||
# 本地图像输入
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
import importlib
|
||||
import os
|
||||
import cv2
|
||||
|
||||
from django.conf import settings
|
||||
import logging
|
||||
import math
|
||||
|
@ -106,6 +106,7 @@ def ai_analyse_2(codes: list, global_img: str, face_img: str = '', is_dahua_pic:
|
|||
|
||||
|
||||
def draw(path, results):
|
||||
import cv2
|
||||
rects = []
|
||||
for i in results:
|
||||
rects.extend(results[i])
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
import os
|
||||
import cv2
|
||||
|
||||
from django.http import HttpResponse
|
||||
from apps.utils.errors import SIGN_MAKE_FAIL
|
||||
from server.settings import BASE_DIR
|
||||
|
@ -29,6 +29,7 @@ class SignatureViewSet(CustomCreateModelMixin, CustomGenericViewSet):
|
|||
|
||||
照片生成透明签名图片
|
||||
"""
|
||||
import cv2
|
||||
path = (BASE_DIR + request.data['path']).replace('\\', '/')
|
||||
try:
|
||||
image = cv2.imread(path, cv2.IMREAD_UNCHANGED)
|
||||
|
|
Loading…
Reference in New Issue