| | |
| | | RuleResult map[string]interface{} // 过完规则后打的标签 face: []FaceResult, yolo: []Result |
| | | } |
| | | |
| | | type TargetInfo struct { |
| | | Rect |
| | | TargetId uint64 |
| | | TargetScore float64 |
| | | } |
| | | // 过规则库打上的标签 |
| | | type Result struct { |
| | | TaskId string // 任务id |
| | |
| | | DefenceState bool // 是否布防 |
| | | AlarmLevel int32 // 报警等级 |
| | | RuleText string // 文字版规则组 |
| | | Location []Rect // 目标的坐标 |
| | | Location []TargetInfo // 目标的坐标 |
| | | AlarmPolygon string // 触发的报警框 |
| | | IsLink bool // 是否是联动任务 |
| | | Others |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 再过其他数据 这步直接得到结果(真或假) 过目标数量 |
| | | for j := 0; j < len(groupRule.Rules); j++ { |
| | | for _, sdkData := range args.Sdkdata { |
| | |
| | | //} |
| | | logger.Warn("___________________________________________________________________________终于走完万里长征") |
| | | // 把他们的位置数据也传下去 |
| | | locations := []Rect{} |
| | | locations := []TargetInfo{} |
| | | for _, sdkData := range args.Sdkdata { |
| | | if sdkData.IpcId == "02D54B61-0F16-C604-8567-FC4BE493C523" && sdkNames != "" { // 把yolo数据的各个目标的坐标输出方便后面画框 |
| | | for _, areaMap := range sdkData.AreaMapList { |
| | |
| | | //logger.Info("-------------------yolo结果标签长度", len(args.RuleResult["yolo"].([]Result))) |
| | | } |
| | | if faceFlag { |
| | | args.RuleResult["face"] = append(args.RuleResult["face"].([]FaceResult), FaceResult{Result{taskId, sdkNames, groupRule.GroupId, groupRule.DefenceState, groupRule.AlarmLevel, groupRule.GroupText, []Rect{}, polygonId, islink,label,}, faces}) |
| | | args.RuleResult["face"] = append(args.RuleResult["face"].([]FaceResult), FaceResult{Result{taskId, sdkNames, groupRule.GroupId, groupRule.DefenceState, groupRule.AlarmLevel, groupRule.GroupText, []TargetInfo{}, polygonId, islink,label,}, faces}) |
| | | //logger.Info("-------------------face结果标签", len(args.RuleResult["face"].([]FaceResult))) |
| | | labelTypes = append(labelTypes,1) |
| | | } |
| | |
| | | return faces |
| | | } |
| | | |
| | | func putYolosToResult(am *AreaMap) []Rect { |
| | | locations := []Rect{} |
| | | func putYolosToResult(am *AreaMap) []TargetInfo { |
| | | locations := []TargetInfo{} |
| | | if len(am.filterData) > 0 { |
| | | for _, data := range am.filterData { |
| | | locations = append(locations, data.Location) |
| | | location := TargetInfo{} |
| | | location.Rect = data.Location |
| | | location.TargetId = data.Id |
| | | location.TargetScore = data.Score |
| | | locations = append(locations, location) |
| | | } |
| | | } |
| | | //logger.Println("-----------------------------------------------听说你是空的?",faces) |