| | |
| | | import ( |
| | | "fmt" |
| | | "ruleprocess/ruleserver" |
| | | "ruleprocess/insertdata" |
| | | |
| | | "sync" |
| | | "analysis/work" |
| | | "basic.com/pubsub/protomsg.git" |
| | | "basic.com/valib/deliver.git" |
| | | "github.com/golang/protobuf/proto" |
| | |
| | | // 把arg里的打的标签拿出来给m再封装一层 |
| | | resultMag := ruleserver.ResultMsg{SdkMessage: m, RuleResult: arg.RuleResult} |
| | | fmt.Println("打完标签后的结果:",resultMag) |
| | | |
| | | // 将打完标签的数据插入到ES |
| | | insertdata.InsertToEs(resultMag) |
| | | } |
| | | } |
| | | } |
| | |
| | | arg.KeepRight = false |
| | | arg.IsStatic = false |
| | | fmt.Println("从mongos中拿到的数据包长度为:", len(msg)) |
| | | for _, sdkinfo := range m.Tasklab.Sdkinfos { |
| | | for _, sdkinfo := range m.Tasklab.Sdkinfos { // yolo算法 |
| | | if sdkinfo.Sdktype == "Yolo" { |
| | | yoloParam := protomsg.ParamYoloObj{} |
| | | err = proto.Unmarshal(sdkinfo.Sdkdata, &yoloParam) |
| | |
| | | } |
| | | |
| | | } |
| | | if sdkinfo.Sdktype == "FaceDetect" { // 人脸检测 |
| | | faceParam := protomsg.ParamFacePos{} |
| | | err = proto.Unmarshal(sdkinfo.Sdkdata, &faceParam) |
| | | if err != nil { |
| | | fmt.Println("解析sdk数据时出现错误", err) |
| | | continue |
| | | } |
| | | for _, info := range faceParam.Faces { |
| | | photoMap := ruleserver.PhotoMap{Rects:nil, Score: float64(info.Pos.Quality)} |
| | | arg.Photo = append(arg.Photo, photoMap) |
| | | } |
| | | } |
| | | //if sdkinfo.Sdktype == "FaceExtract" { // 人脸提取 |
| | | |
| | | //} |
| | | |
| | | } |
| | | return m |
| | | } |