| | |
| | | ageDescription := getDescription(face.ThftRes.Age) |
| | | logger.Info(ageDescription) |
| | | var target = new(Target) |
| | | target.TargetId = strconv.FormatUint(face.Id, 10) |
| | | target.TargetId = face.Id |
| | | target.TargetScore = face.Score |
| | | target.TargetLocation = Points{TopLeft: Point{face.Location.X, face.Location.Y}, BottomRight: Point{face.Location.X + face.Location.Width, face.Location.Y + face.Location.Height}} |
| | | //logger.Info("人脸的id:",strconv.FormatUint(face.Id, 10)) |
| | |
| | | msg.Tasklab.Taskid, |
| | | msg.Tasklab.Taskname, |
| | | "人脸", |
| | | "", |
| | | time.Now().Format("2006-01-02 15:04:05"), |
| | | alarmRules, |
| | | time.Now().Format("2006-01-02 15:04:05"), // 只检测,没有比对时间 |
| | | sex, //暂改为人脸id strconv.FormatUint(face.Id, 10) |
| | |
| | | linkInfo = "联动任务" |
| | | } |
| | | alarmRules = append(alarmRules, AlarmRule{yoloResult.RuleGroupId, alarm, yoloResult.RuleText, yoloResult.DefenceState, linkInfo}) |
| | | logger.Info("打印任务名称:",) |
| | | // 上传缓存数据的图片拿到url |
| | | if yoloResult.Others.CacheData != nil { |
| | | //InsertYolo(msg.RuleResult["cacheData"].(ruleserver.ResultMsg)) |
| | |
| | | // 去重添加 |
| | | var flag = true |
| | | for _, selectTarget := range targetInfos { |
| | | if strconv.FormatUint(target.Id, 10) == selectTarget.TargetId { |
| | | if target.Id == selectTarget.TargetId { |
| | | flag = false |
| | | break |
| | | } |
| | | } |
| | | if flag { |
| | | var target1 = new(Target) |
| | | target1.TargetId = strconv.FormatUint(target.Id, 10) |
| | | target1.TargetId = target.Id |
| | | target1.TargetScore = target.Score |
| | | target1.TargetLocation = Points{TopLeft: Point{target.Location.X, target.Location.Y}, BottomRight: Point{target.Location.X + target.Location.Width, target.Location.Y + target.Location.Height}} |
| | | targetInfos = append(targetInfos, *target1) |
| | |
| | | msg.Tasklab.Taskid, |
| | | msg.Tasklab.Taskname, |
| | | sdkNames, |
| | | "", |
| | | time.Now().Format("2006-01-02 15:04:05"), |
| | | alarmRules, |
| | | msg.Push.ServerId, |
| | | msg.Push.ServerName, |
| | |
| | | } |
| | | if resp["fileUrl"] != nil { |
| | | url = append(url, resp["fileUrl"].(string)) |
| | | if len(url) == 1 { |
| | | return |
| | | } |
| | | //esDataId := uuid.NewV4().String() |
| | | peraction := Personaction{ |
| | | msg.Push.PushId, |
| | |
| | | msg.Tasklab.Taskid, |
| | | msg.Tasklab.Taskname, |
| | | sdkNames, |
| | | "", |
| | | time.Now().Format("2006-01-02 15:04:05"), |
| | | alarmRules, |
| | | msg.Push.ServerId, |
| | | msg.Push.ServerName, |
| | |
| | | // 去重添加 |
| | | var flag = true |
| | | for _, selectTarget := range targetInfos { |
| | | if strconv.FormatUint(target.Id, 10) == selectTarget.TargetId { |
| | | if target.Id == selectTarget.TargetId { |
| | | flag = false |
| | | break |
| | | } |
| | | } |
| | | if flag { |
| | | var target1 = new(Target) |
| | | target1.TargetId = strconv.FormatUint(target.Id, 10) |
| | | target1.TargetId = target.Id |
| | | target1.TargetScore = target.Score |
| | | target1.TargetLocation = Points{TopLeft: Point{target.Location.X, target.Location.Y}, BottomRight: Point{target.Location.X + target.Location.Width, target.Location.Y + target.Location.Height}} |
| | | targetInfos = append(targetInfos, *target1) |