| | |
| | | race := getRaceString(face.ThftRes.Race) |
| | | ageDescription := getDescription(face.ThftRes.Age) |
| | | logger.Info(ageDescription) |
| | | esDataId := uuid.NewV4().String() |
| | | //esDataId := uuid.NewV4().String() |
| | | linksId := "" |
| | | if linkId != "" { |
| | | linksId = linkId |
| | |
| | | //logger.Info("人脸的id:",strconv.FormatUint(face.Id, 10)) |
| | | logger.Info("%%%%%%%%%%%%%%%%%%%%%目标信息:",*target) |
| | | pervideo := PerVideoPicture{ |
| | | esDataId, |
| | | msg.Push.PushId, |
| | | msg.Cid, |
| | | msg.Push.Cam.Addr, |
| | | picTime, |
| | |
| | | face.ThftRes.Beauty, |
| | | base64.StdEncoding.EncodeToString(face.Feature), |
| | | []string{resp["fileUrl"].(string)}, |
| | | msg.Push.VideoUrl, |
| | | "", |
| | | msg.Push.ServerId, |
| | | msg.Push.ServerName, |
| | | msg.Push.LocalIp, |
| | |
| | | } else { |
| | | logger.Info("插入es返回的信息:", resp1) |
| | | // 发出录像信号 |
| | | ruleserver.AddLxMessage(&protomsg.VideotapeInfo{EsDataId: esDataId, CameraId: msg.Cid, TaskId: msg.Tasklab.Taskid, VideoUrl:msg.Push.VideoUrl,ImgId: i.Id, SdkIds: []string{}, Type: 1}) |
| | | ruleserver.AddLxMessage(&protomsg.VideotapeInfo{EsDataId: msg.Push.PushId, CameraId: msg.Cid, TaskId: msg.Tasklab.Taskid, VideoUrl:msg.Push.VideoUrl,ImgId: i.Id, SdkIds: []string{}, Type: 1}) |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | if resp["fileUrl"] != nil { |
| | | url = append(url, resp["fileUrl"].(string)) |
| | | esDataId := uuid.NewV4().String() |
| | | //esDataId := uuid.NewV4().String() |
| | | linksId := "" |
| | | if linkId != "" { |
| | | linksId = linkId |
| | | } |
| | | peraction := Personaction{ |
| | | esDataId, |
| | | msg.Push.PushId, |
| | | msg.Cid, |
| | | msg.Push.Cam.Name, |
| | | msg.Push.Cam.Addr, |
| | |
| | | url, |
| | | i.Timestamp, |
| | | linksId, |
| | | msg.Push.VideoUrl, |
| | | "", |
| | | isAlarm, |
| | | 0, |
| | | 0, |
| | |
| | | if err != nil { |
| | | logger.Info("json parse error ", err) |
| | | return |
| | | |
| | | } |
| | | resp1, err2 := EsReq("POST", personAction, requstbody) |
| | | if err2 != nil { |
| | |
| | | } else { |
| | | logger.Debug("插入es返回的数据信息是:", resp1) |
| | | // 发出录像信号 |
| | | logger.Info("给录像的视频地址:",msg.Push.VideoUrl) |
| | | ruleserver.AddLxMessage(&protomsg.VideotapeInfo{EsDataId: esDataId, CameraId: msg.Cid, TaskId: msg.Tasklab.Taskid,VideoUrl:msg.Push.VideoUrl, ImgId: i.Id, SdkIds: []string{}, Type: 2}) |
| | | ruleserver.AddLxMessage(&protomsg.VideotapeInfo{EsDataId: msg.Push.PushId, CameraId: msg.Cid, TaskId: msg.Tasklab.Taskid,VideoUrl:msg.Push.VideoUrl, ImgId: i.Id, SdkIds: []string{}, Type: 2}) |
| | | logger.Warn("__________________________________________往ES插入yolo数据成功") |
| | | //os.Exit(1) |
| | | } |
| | |
| | | import ( |
| | | "basic.com/pubsub/protomsg.git" |
| | | "basic.com/valib/logger.git" |
| | | uuid "github.com/satori/go.uuid" |
| | | "ruleprocess/cache" |
| | | "basic.com/fileserver/WeedFSClient.git" |
| | | "strconv" |
| | | ) |
| | | func GetAttachInfo(msg *protomsg.SdkMessage){ |
| | | //人脸检测,没有相似的底库人员 |
| | |
| | | logger.Error("查询摄像机信息失败") |
| | | } |
| | | push.Cam = &camera |
| | | msg.Push.PushId = uuid.NewV4().String() |
| | | // 视频地址占位符 |
| | | localConfig1, err := cache.GetServerInfo() |
| | | if err != nil { |
| | | panic("配置文件不合法") |
| | | } |
| | | logger.Info("请求视频路径:",msg.Push,serverIp,camera) |
| | | weedfsUrl := "http://" + localConfig1.WebPicIp + ":" + strconv.Itoa(int(localConfig1.WebPicPort)) + "/dir/assign" |
| | | if path,err := WeedFSClient.GetFid(weedfsUrl);err != nil { |
| | | logger.Info("请求文件地址失败:",err) |
| | | } else { |
| | | logger.Info("视频路径为:",path) |
| | | push.VideoUrl = path |
| | | } |
| | | //localConfig1, err := cache.GetServerInfo() |
| | | //if err != nil { |
| | | // panic("配置文件不合法") |
| | | //} |
| | | //logger.Info("请求视频路径:",msg.Push,serverIp,camera) |
| | | // weedfsUrl := "http://" + localConfig1.WebPicIp + ":" + strconv.Itoa(int(localConfig1.WebPicPort)) + "/dir/assign" |
| | | //if path,err := WeedFSClient.GetFid(weedfsUrl);err != nil { |
| | | // logger.Info("请求文件地址失败:",err) |
| | | //} else { |
| | | // logger.Info("视频路径为:",path) |
| | | // push.VideoUrl = path |
| | | //} |
| | | msg.Push = push |
| | | } |