| | |
| | | } else { |
| | | //runtime.GOMAXPROCS(runtime.NumCPU()) |
| | | //logger.Debug("使用的cpu个数:",runtime.NumCPU()) |
| | | //go func(msg []byte) { |
| | | go func(msg []byte) { |
| | | logger.Debug("当前时间戳:", time.Now().Unix()) |
| | | arg := structure.SdkDatas{} |
| | | //paramFormat(msg, &arg) |
| | |
| | | logger.Debug("插入完Es所用时间:", time.Since(start)) |
| | | //事件推送 |
| | | //go labelFilter.Judge(resultMsg) |
| | | //}(msg) |
| | | }(msg) |
| | | } |
| | | } |
| | | } |
| | |
| | | // 将外部传进来的rect(top,bottom,left,right)转化为自己内部的rect(left top width height) |
| | | func rectFormat(rcobj *protomsg.Rect) structure.Rect { |
| | | //logger.Info("++++++++++++++++++++++++++++++收到的yolo的区域坐标:",rcobj) |
| | | rect := ruleserver.Rect{} |
| | | rect := structure.Rect{} |
| | | rect.X = float64(rcobj.Left) |
| | | rect.Y = float64(rcobj.Top) |
| | | rect.Width = float64(rcobj.Right - rcobj.Left) |
| | |
| | | for _, info := range yoloParam.Infos { |
| | | if info.Typ == 0 { |
| | | //logger.Debug("-------------yolo的坐标有几个",info.RcObj) |
| | | photoMap := structure.PhotoMap{Rects: rectFormat(info.RcObj), Score: float64(info.Prob) * 100, IsYolo: true} |
| | | photoMap := structure.PhotoMap{Rects: rectFormat(info.RcObj), Score: float64(info.Prob) * 100, IsYolo: true,Id:info.ObjID} |
| | | arg.Photo = append(arg.Photo, photoMap) |
| | | yoloNum++ |
| | | } |