| | |
| | | "basic.com/pubsub/protomsg.git" |
| | | "github.com/golang/protobuf/proto" |
| | | "ruleprocess/logger" |
| | | "ruleprocess/structure" |
| | | ) |
| | | |
| | | var TrackPond = make(map[string]*PersonTrack) |
| | |
| | | // 检查是否前后两次的数据id是否完全相同(人脸) |
| | | func FaceIsSame(msg *protomsg.SdkMessage) { |
| | | logger.Debug("+++++++++++++++++++++追踪开始+++++++++++++++摄像机id为:", msg.Cid, "---缓存池为:", TrackPond) |
| | | if msg.Tasklab == nil { |
| | | logger.Info("数据为空,不必追踪") |
| | | return |
| | | } |
| | | for _, sdkinfo := range msg.Tasklab.Sdkinfos { // 遍历各算法的sdkData |
| | | if sdkinfo.Sdktype == "FaceDetect" { // 人脸检测 |
| | | logger.Info("数据长度为:", len(sdkinfo.Sdkdata)) |
| | |
| | | return false |
| | | } |
| | | func TrackOrNot(label map[string]interface{}) bool{ |
| | | if label["yolo"] != nil && len(label["yolo"].([]Result)) > 0 { |
| | | for _,res := range label["yolo"].([]Result) { |
| | | if label["yolo"] != nil && len(label["yolo"].([]structure.Result)) > 0 { |
| | | for _,res := range label["yolo"].([]structure.Result) { |
| | | if res.TimeLabel == "10" { |
| | | return true |
| | | } |