| | |
| | | import ( |
| | | "basic.com/pubsub/protomsg.git" |
| | | "github.com/golang/protobuf/proto" |
| | | "ruleprocess/logger" |
| | | "basic.com/valib/logger.git" |
| | | "ruleprocess/structure" |
| | | ) |
| | | |
| | | var TrackPond = make(map[string]*PersonTrack) |
| | |
| | | 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 |
| | | } |
| | |
| | | } |
| | | |
| | | // 过滤掉那些已在缓存中且分值更低的人脸,更新缓存(没有的加上,分值更新为更高的,多的删除) |
| | | func FaceIsInPond(cameraId string, sdkinfor *protomsg.SdkmsgWithTask) string { |
| | | func FaceIsInPond(cameraId string, sdkinfor *protomsg.SdkmsgWithTask) { |
| | | if TrackPond[cameraId] != nil { |
| | | logger.Info("----马前炮:", TrackPond[cameraId], "=====", len(TrackPond[cameraId].Faces)) |
| | | for _,face := range TrackPond[cameraId].Faces { |
| | |
| | | } |
| | | } |
| | | } else { |
| | | return "false" |
| | | TrackPond[cameraId] = &PersonTrack{Faces: nil} |
| | | } |
| | | return "false" |
| | | } |