From 47355e1e3a57f9448918ac411178d60142f41d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Fri, 26 Aug 2022 16:44:46 +0800 Subject: [PATCH] =?UTF-8?q?celery=20task=20=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ecm/tasks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/ecm/tasks.py b/apps/ecm/tasks.py index d89e4c2f..d90c8468 100644 --- a/apps/ecm/tasks.py +++ b/apps/ecm/tasks.py @@ -3,10 +3,11 @@ from multiprocessing import Event from threading import Thread from celery import shared_task +from apps.ai.main import ai_analyse from apps.am.models import Area from apps.ecm.models import EventCate, Eventdo -from apps.ecm.service import algo_handle, notify_event, save_dahua_pic +from apps.ecm.service import notify_event, save_dahua_pic from apps.hrm.models import Employee from apps.opm.models import Opl from apps.third.clients import xxClient @@ -80,7 +81,7 @@ def snap_and_analyse(code: str, algo_codes: list, opl_id: str): global_img_o = dhClient.snap(code) happen_time = timezone.now() vchannel = TDevice.objects.filter(code=code).first() - ec_codes = algo_handle(algo_codes, data={}) # 算法处理返回的事件结果 + ec_codes = ai_analyse(algo_codes, global_img=global_img_o) # 算法处理返回的事件结果 if ec_codes: # 获取本次所有发生事件种类 ecs = EventCate.objects.filter(code__in=ec_codes)