|
@@ -181,10 +181,10 @@ class AiView(View):
|
|
# self.del_path(os.path.join(BASE_DIR, 'static/ai/' + uid))
|
|
# self.del_path(os.path.join(BASE_DIR, 'static/ai/' + uid))
|
|
logger.info('没有识别到任何标签-----------------')
|
|
logger.info('没有识别到任何标签-----------------')
|
|
return response.json(10055)
|
|
return response.json(10055)
|
|
- event_type_list = labels['user_detect_group']
|
|
|
|
|
|
+ eventType = labels['eventType']
|
|
label_str = ','.join(labels['label_list'])
|
|
label_str = ','.join(labels['label_list'])
|
|
new_bounding_box_dict = labels['new_bounding_box_dict']
|
|
new_bounding_box_dict = labels['new_bounding_box_dict']
|
|
- logger.info(event_type_list)
|
|
|
|
|
|
+ logger.info(eventType)
|
|
logger.info(label_str)
|
|
logger.info(label_str)
|
|
|
|
|
|
# 上传缩略图到s3
|
|
# 上传缩略图到s3
|
|
@@ -230,21 +230,20 @@ class AiView(View):
|
|
userID_id = up["userID_id"]
|
|
userID_id = up["userID_id"]
|
|
if userID_id not in userID_ids:
|
|
if userID_id not in userID_ids:
|
|
now_time = int(time.time())
|
|
now_time = int(time.time())
|
|
- for event_type in event_type_list: #分别存储多个类型的ai推送消息
|
|
|
|
- eq_list.append(Equipment_Info(
|
|
|
|
- userID_id=userID_id,
|
|
|
|
- eventTime=n_time,
|
|
|
|
- eventType=event_type,
|
|
|
|
- devUid=uid,
|
|
|
|
- devNickName=nickname,
|
|
|
|
- Channel=channel,
|
|
|
|
- alarm='检查到{labels} \tChannel:{channel}'.format(labels=label_str,channel=channel),
|
|
|
|
- is_st=is_st,
|
|
|
|
- receiveTime=receiveTime,
|
|
|
|
- addTime=now_time,
|
|
|
|
- storage_location=2,
|
|
|
|
- borderCoords=json.dumps(new_bounding_box_dict)
|
|
|
|
- ))
|
|
|
|
|
|
+ eq_list.append(Equipment_Info(
|
|
|
|
+ userID_id=userID_id,
|
|
|
|
+ eventTime=n_time,
|
|
|
|
+ eventType=eventType,
|
|
|
|
+ devUid=uid,
|
|
|
|
+ devNickName=nickname,
|
|
|
|
+ Channel=channel,
|
|
|
|
+ alarm='检查到{labels} \tChannel:{channel}'.format(labels=label_str,channel=channel),
|
|
|
|
+ is_st=is_st,
|
|
|
|
+ receiveTime=receiveTime,
|
|
|
|
+ addTime=now_time,
|
|
|
|
+ storage_location=2,
|
|
|
|
+ borderCoords=json.dumps(new_bounding_box_dict)
|
|
|
|
+ ))
|
|
userID_ids.append(userID_id)
|
|
userID_ids.append(userID_id)
|
|
|
|
|
|
# 推送标题
|
|
# 推送标题
|
|
@@ -254,7 +253,7 @@ class AiView(View):
|
|
kwargs = {
|
|
kwargs = {
|
|
'uid': uid,
|
|
'uid': uid,
|
|
'channel': channel,
|
|
'channel': channel,
|
|
- 'event_type': event_type_list,
|
|
|
|
|
|
+ 'event_type': eventType,
|
|
'n_time': n_time,
|
|
'n_time': n_time,
|
|
'appBundleId': appBundleId,
|
|
'appBundleId': appBundleId,
|
|
'token_val': token_val,
|
|
'token_val': token_val,
|
|
@@ -371,8 +370,11 @@ class AiView(View):
|
|
new_bounding_box_dict["file_{i}".format(i=i)].append(boxDict)
|
|
new_bounding_box_dict["file_{i}".format(i=i)].append(boxDict)
|
|
# exit(new_bounding_box_list)
|
|
# exit(new_bounding_box_list)
|
|
conform_user_d_group = list(conform_user_d_group)
|
|
conform_user_d_group = list(conform_user_d_group)
|
|
- conform_user_d_group.sort()
|
|
|
|
- return {'user_detect_group': conform_user_d_group, 'label_list': conform_label_list,
|
|
|
|
|
|
+ if len(conform_user_d_group) > 1:
|
|
|
|
+ eventType = conform_user_d_group[0]
|
|
|
|
+ else:
|
|
|
|
+ eventType = 123 #组合类型
|
|
|
|
+ return {'eventType': eventType, 'label_list': conform_label_list,
|
|
'new_bounding_box_dict':new_bounding_box_dict}
|
|
'new_bounding_box_dict':new_bounding_box_dict}
|
|
|
|
|
|
|
|
|