| | |
| | | videoPersonUrl = "http://" + localConfig1.AlarmIp + ":" + strconv.Itoa(int(localConfig1.AlarmPort)) + "/" + EsInfo.EsIndex.VideoPersons.IndexName + "/" + EsInfo.EsIndex.VideoPersons.IndexType |
| | | personAction = "http://" + localConfig1.AlarmIp + ":" + strconv.Itoa(int(localConfig1.AlarmPort)) + "/" + EsInfo.EsIndex.Personaction.IndexName + "/" + EsInfo.EsIndex.Personaction.IndexType |
| | | InsertFace(msg, "") |
| | | // 如果标签中含有持续时间首次报警的timeLabel的话则不需要过人体追踪,不然就没的插入了 |
| | | fk := ruleserver.TrackOrNot(msg.RuleResult) |
| | | if fk { |
| | | InsertYolo(msg, "") |
| | | //if msg.Cid == "61de081a-7ed9-4970-8432-41d642c35456" { |
| | | // logger.Warn("捕捉188摄像机的持续时间任务.....") |
| | | // os.Exit(1) |
| | | //} |
| | | } else { |
| | | flag := ruleserver.BodyIsSame(msg.SdkMessage) |
| | | if !flag { |
| | | InsertYolo(msg, "") |
| | | } |
| | | } |
| | | InsertYolo(msg, "") |
| | | } |
| | | |
| | | // 往es中插入人脸数据 |
| | |
| | | } |
| | | } |
| | | if result.RuleResult["yolo"] != nil && len(result.RuleResult["yolo"].([]structure.Result)) > 0 { |
| | | |
| | | for _,yoloGroup := range result.RuleResult["yolo"].([]structure.Result) { |
| | | label.DefenceLevel = append(label.DefenceLevel,yoloGroup.AlarmLevel) |
| | | } |
| | |
| | | "basic.com/pubsub/protomsg.git" |
| | | "basic.com/valib/logger.git" |
| | | "github.com/knetic/govaluate" |
| | | "ruleprocess/ruleserver" |
| | | "ruleprocess/structure" |
| | | "strconv" |
| | | "time" |
| | | ) |
| | | |
| | | func PushSomthing (msg structure.ResultMsg) { |
| | | // 如果标签中含有持续时间首次报警的timeLabel的话则不需要过人体追踪,不然就没的插入了 |
| | | fk := ruleserver.TrackOrNot(msg.RuleResult) |
| | | if fk { |
| | | Judge(msg) |
| | | } else { |
| | | flag := ruleserver.BodyIsSame(msg.SdkMessage) |
| | | if !flag { |
| | | Judge(msg) |
| | | } |
| | | } |
| | | } |
| | | func Judge(msg structure.ResultMsg) { |
| | | func PushSomthing(msg structure.ResultMsg) { |
| | | defer func() { |
| | | if err := recover(); err != nil { |
| | | logger.Error("事件推送模块儿的异常捕获:",err) |
| | |
| | | } |
| | | } |
| | | } |
| | | // 人体追踪 |
| | | // 如果标签中含有持续时间首次报警的timeLabel的话则不需要过人体追踪,不然就没的插入了 |
| | | fk := TrackOrNot(args.RuleResult) |
| | | if !fk { |
| | | BodyIsSame(message) |
| | | } |
| | | } |
| | | } |
| | | } |