| | |
| | | Content string `json:"content"` |
| | | AlarmRules []AlarmRule `json:"alarmRules"` |
| | | LikeDate string `json:"likeDate"` |
| | | ShowLabels string `json:"showLables"` |
| | | OtherLabels string `json:"otherLables"` |
| | | ShowLabels string `json:"showLabels"` |
| | | OtherLabels string `json:"otherLabels"` |
| | | VideoUrl string `json:"videoUrl"` |
| | | AnalyServerId string `json:"analyServerId"` |
| | | AnalyServerName string `json:"analyServerName"` |
| | |
| | | Content string `json:"content"` |
| | | AlarmRules []AlarmRule `json:"alarmRules"` |
| | | LikeDate string `json:"likeDate"` |
| | | ShowLabels string `json:"showLables"` |
| | | OtherLabels string `json:"otherLables"` |
| | | ShowLabels string `json:"showLabels"` |
| | | OtherLabels string `json:"otherLabels"` |
| | | VideoUrl string `json:"videoUrl"` |
| | | AnalyServerId string `json:"analyServerId"` |
| | | AnalyServerName string `json:"analyServerName"` |
| | |
| | | type Target struct { |
| | | TargetId string `json:"targetId"` |
| | | TargetScore float64 `json:"targetScore"` |
| | | FaceFeature string `json:"faceFeature"` |
| | | Feature string `json:"feature"` |
| | | PicSmUrl string `json:"picSmUrl"` |
| | | TargetLocation Points `json:"targetLocation"` |
| | | } |
| | |
| | | X float64 `json:"x"` |
| | | Y float64 `json:"y"` |
| | | } |
| | | |
| | | // yolo行为的数据结构 |
| | | //type Personaction struct { |
| | | // Id string `json:"id"` |
| | | // CameraId string `json:"cameraId"` |
| | | // CameraName string `json:"cameraName"` |
| | | // CameraAddr string `json:"cameraAddr"` |
| | | // TaskId string `json:"taskId"` |
| | | // TaskName string `json:"taskName"` |
| | | // SdkName string `json:"sdkName"` |
| | | // Content string `json:"content"` |
| | | // AlarmRules []AlarmRule `json:"alarmRules"` |
| | | // AnalyServerId string `json:"analyServerId"` |
| | | // AnalyServerName string `json:"analyServerName"` |
| | | // AnalyServerIp string `json:"analyServerIp"` |
| | | // ClusterId string `json:"clusterId"` |
| | | // PicSmUrl []string `json:"picSmUrl"` |
| | | // PicDate string `json:"picDate"` |
| | | // VideoUrl string `json:"videoUrl"` |
| | | // IsAlarm int `json:"isAlarm"` |
| | | // IsAckAlarm int `json:"isAckAlarm"` |
| | | // IsCollect int `json:"isCollect"` |
| | | // IsDelete int `json:"isDelete"` |
| | | // TargetInfo []Target `json:"targetInfo"` |
| | | // LinkTag string `json:"linkTag"` |
| | | // LinkTagInfo []*LinkInfo `json:"linkTagInfo"` |
| | | //} |
| | | |
| | | type AlarmRule struct { |
| | | GroupId string `json:"groupId"` |
| | |
| | | } |
| | | |
| | | func InsertToEs(msg structure.ResultMsg) { |
| | | //defer func() { |
| | | // if err := recover(); err != nil { |
| | | // logger.Error("es模块儿的异常捕获:", err) |
| | | // } |
| | | //}() |
| | | defer func() { |
| | | if err := recover(); err != nil { |
| | | logger.Error("es模块儿的异常捕获:", err) |
| | | } |
| | | }() |
| | | localConfig1, err := cache.GetServerInfo() |
| | | if err != nil { |
| | | panic("配置文件不合法") |
| | |
| | | var target = new(Target) |
| | | target.TargetId = face.Id |
| | | target.TargetScore = face.Score |
| | | target.FaceFeature = base64.StdEncoding.EncodeToString(face.Feature) |
| | | target.Feature = base64.StdEncoding.EncodeToString(face.Feature) |
| | | target.PicSmUrl = resp["fileUrl"].(string) |
| | | 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}} |
| | | var targetInfos []Target |
| | | targetInfos = append(targetInfos, *target) |
| | | |
| | | sdkname := "" |
| | | switch key { |
| | | case "face": |
| | | sdkname = "人脸" |
| | | case "plate": |
| | | sdkname = "车牌识别" |
| | | } |
| | | logger.Info("人脸目标target:",targetInfos) |
| | | pervideo := PerVideoPicture{ |
| | | face.Uuid, |
| | | msg.Cid, |
| | |
| | | imgMaxUrl, |
| | | msg.Tasklab.Taskid, |
| | | msg.Tasklab.Taskname, |
| | | "人脸", |
| | | time.Now().Format("2006-01-02 15:04:05"), |
| | | sdkname, |
| | | "", |
| | | alarmRules, |
| | | time.Now().Format("2006-01-02 15:04:05"), // 只检测,没有比对时间 |
| | | lable, |
| | |
| | | if err1 != nil { |
| | | logger.Error("上传ES出错!---", err1) |
| | | } else { |
| | | logger.Info("插入es返回的信息(人脸):", resp1) |
| | | logger.Info("插入es返回的信息:", sdkname, "---", resp1) |
| | | // 发出录像信号 |
| | | ruleserver.AddLxMessage(&protomsg.VideotapeInfo{EsDataId: face.Uuid, CameraId: msg.Cid, TaskId: msg.Tasklab.Taskid, VideoUrl: msg.Push.VideoUrl, ImgId: i.Id, SdkIds: []string{"-1"}, Type: 1}) |
| | | } |
| | |
| | | false, |
| | | false, |
| | | nil, |
| | | nil, |
| | | targetInfos, |
| | | linkTag, |
| | | linkTagInfos, |
| | | } |
| | |
| | | } |
| | | race := getRaceString(obj.ThftRes.Race) |
| | | ageDescription := getDescription(obj.ThftRes.Age) |
| | | lable = sex + "//" + ageDescription + "//" + race + "//" |
| | | lableAttach = strconv.Itoa(int(obj.ThftRes.Age)) + "岁" + "//" + "微笑值:" + strconv.Itoa(int(obj.ThftRes.Smile)) + "//" + "颜值:" + strconv.Itoa(int(obj.ThftRes.Beauty)) |
| | | lable = sex + "/" + ageDescription + "/" + race |
| | | lableAttach = strconv.Itoa(int(obj.ThftRes.Age)) + "岁" + "/" + "微笑值:" + strconv.Itoa(int(obj.ThftRes.Smile)) + "/" + "颜值:" + strconv.Itoa(int(obj.ThftRes.Beauty)) |
| | | |
| | | case "plate": |
| | | // 车牌运动方向,0 unknown, 1 left, 2 right, 3 up, 4 down |
| | | lable = obj.Car.License + "//" + cache.GetDic("nColor"+strconv.Itoa(int(obj.Car.NColor))) + "车牌" + "//" + |
| | | cache.GetDic("nCarColor"+strconv.Itoa(int(obj.Car.NCarColor))) + "车辆" + "//" + cache.GetDic("nCarLogo"+strconv.Itoa(int(obj.Car.NCarLogo))) + "//" + cache.GetDic("nCarLogo"+strconv.Itoa(int(obj.Car.NCarType))) |
| | | lableAttach = cache.GetDic("nDirection"+strconv.Itoa(int(obj.Car.NDirection))) + "//" + "车牌置信度:" + strconv.Itoa(int(obj.Car.NConfidence)) + "//" + |
| | | "车牌亮度:" + strconv.Itoa(int(obj.Car.NBright)) + "//" + "车的亮度:" + strconv.Itoa(int(obj.Car.NCarBright)) + "//" + "识别时间:" + strconv.Itoa(int(obj.Car.NTime)) |
| | | logger.Info("车辆车牌信息:", obj.Car.NColor, obj.Car.NCarColor, obj.Car.NCarLogo, obj.Car.NCarType, obj.Car.NDirection) |
| | | lable = obj.Car.License + "/" + cache.GetDic("nColor"+strconv.Itoa(int(obj.Car.NColor))) + "车牌" + "/" + |
| | | cache.GetDic("nCarColor"+strconv.Itoa(int(obj.Car.NCarColor))) + "车辆" + "/" + "品牌:" + cache.GetDic("nCarLogo"+strconv.Itoa(int(obj.Car.NCarLogo))) + "/" + "型号:" + cache.GetDic("nCarType"+strconv.Itoa(int(obj.Car.NCarType))) |
| | | lableAttach = "运动方向:" + cache.GetDic("nDirection"+strconv.Itoa(int(obj.Car.NDirection))) + "/" + "车牌置信度:" + strconv.Itoa(int(obj.Car.NConfidence)) + "/" + |
| | | "车牌亮度:" + strconv.Itoa(int(obj.Car.NBright)) + "/" + "车的亮度:" + strconv.Itoa(int(obj.Car.NCarBright)) + "/" + "识别时间:" + strconv.Itoa(int(obj.Car.NTime)) |
| | | } |
| | | return lable, lableAttach |
| | | } |