标注坐标位置接口bug
This commit is contained in:
parent
26a8ca05d1
commit
0bd71ba016
|
@ -1,10 +1,7 @@
|
|||
import traceback
|
||||
|
||||
import grpc
|
||||
import BeiHangGrpc_pb2_grpc
|
||||
import BeiHangGrpc_pb2
|
||||
import logging
|
||||
|
||||
myLogger = logging.getLogger('log')
|
||||
|
||||
|
||||
def helmet(ip: str, pic_url: str):
|
||||
|
@ -25,15 +22,12 @@ def helmet(ip: str, pic_url: str):
|
|||
# request = BeiHangGrpc_pb2.JinYu_Request(zzid=image_id,imgsbase64=image_base64)
|
||||
|
||||
request = BeiHangGrpc_pb2.JinYu_Request(zzid=image_id, imgUrl=pic_url)
|
||||
try:
|
||||
response = stub.sendHelmet_Info(request)
|
||||
if response.helmetinfoList:
|
||||
for i in response.helmetinfoList:
|
||||
if i.head_helmet == 0:
|
||||
return True, response
|
||||
return False, response
|
||||
except Exception:
|
||||
myLogger.error(traceback.format_exc())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
class AiService:
|
||||
|
||||
algo_dict = {
|
||||
"helmet": "apps.helmet.algo.helmet"
|
||||
}
|
||||
|
||||
|
||||
class AiService:
|
||||
|
||||
def analyse(codes: list, path: str):
|
||||
"""多线程进行算法分析图片
|
||||
|
||||
|
@ -10,4 +13,6 @@ class AiService:
|
|||
codes: 算法列表
|
||||
path (str): 图片地址
|
||||
"""
|
||||
for i in codes:
|
||||
if i in algo_dict:
|
||||
pass
|
||||
|
|
|
@ -376,7 +376,7 @@ class TDeviceViewSet(ListModelMixin, UpdateModelMixin, DestroyModelMixin, Custom
|
|||
|
||||
@action(methods=['post'], detail=True, perms_map={'post': 'tdevice.label_location'},
|
||||
serializer_class=LabelLocationSerializer)
|
||||
def label_location(self, request):
|
||||
def label_location(self, request, pk=None):
|
||||
"""
|
||||
标注坐标位置
|
||||
|
||||
|
|
Loading…
Reference in New Issue