From 24ed193984da270b3cc5fd6d58803d95482c6ea1 Mon Sep 17 00:00:00 2001 From: panlei <2799247126@qq.com> Date: 星期一, 16 十二月 2019 16:09:42 +0800 Subject: [PATCH] 小结果中加了一个参数 --- algorithm/middleware/readyData.go | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/algorithm/middleware/readyData.go b/algorithm/middleware/readyData.go index cd95366..e173812 100644 --- a/algorithm/middleware/readyData.go +++ b/algorithm/middleware/readyData.go @@ -3,6 +3,8 @@ import ( "basic.com/pubsub/protomsg.git" "basic.com/valib/logger.git" + "encoding/base64" + "encoding/json" "github.com/golang/protobuf/proto" uuid "github.com/satori/go.uuid" "ruleprocess/ruleserver" @@ -54,7 +56,7 @@ } for _, polygon := range cameraPolygons { //logger.Println("++++++鍦ㄨ繖鍎跨湅涓�涓嬪尯鍩熷晩:", polygon.Polygon) - areaMap := structure.AreaMap{CameraId: cameraId, AreaId: polygon.Id, AreaJson: polygon.Polygon, TriggerLine: polygon.TriggerLine, DirectionLine: polygon.DirectionLine} + areaMap := structure.AreaMap{CameraId: cameraId, AreaId: polygon.Id,AreaJson: polygon.Polygon, TriggerLine: polygon.TriggerLine, DirectionLine: polygon.DirectionLine} // 涓烘瘡涓憚鍍忔満鍖哄煙濉厖鏁版嵁 CountAreaObjs(&areaMap,arg) arg.AreaMapList = append(arg.AreaMapList, &areaMap) @@ -134,7 +136,7 @@ logger.Info("--------------杩借釜涔嬪悗浜鸿劯鐨勪釜鏁帮細", len(faceParam.Faces)) for _, info := range faceParam.Faces { //logger.Info("_______________________________________________绗竴娆$湅鐩镐技鍊硷細",info.Pos.FAngle.Confidence*100) - photoMap := structure.PhotoMap{structure.SourcePhoto{Id: strconv.Itoa(int(info.Pos.FaceID)) , Rects: rectFormat(info.Pos.RcFace), Score: float64(info.Pos.FAngle.Confidence * 100), Type: "face", ThftRes: *(info.Result), Feature: info.Feats},structure.SourcePhoto{}} + photoMap := structure.PhotoMap{structure.SourcePhoto{Id: strconv.Itoa(int(info.Pos.FaceID)) , Rects: rectFormat(info.Pos.RcFace), Score: float64(info.Pos.FAngle.Confidence * 100), Type: "face", ThftRes: *(info.Result), Feature: base64.StdEncoding.EncodeToString(info.Feats)},structure.SourcePhoto{}} arg.Photo = append(arg.Photo, photoMap) } args.Sdkdata = append(args.Sdkdata, &arg) @@ -219,8 +221,9 @@ return } for _, info := range Track.Result { - logger.Info("鎺ユ敹璺熻釜鏁版嵁锛�",info.Id,info.Confidence) - photoMap := structure.PhotoMap{structure.SourcePhoto{Id: strconv.Itoa(int(info.Id)),Score: float64(info.Confidence)*100,Rects: rectFormat(info.RcHuman), Type: "track"},structure.SourcePhoto{}} + logger.Info("鎺ユ敹璺熻釜鏁版嵁锛�",info.Id,info.Confidence,info.Feature) + b,_ := json.Marshal(info.Feature) + photoMap := structure.PhotoMap{structure.SourcePhoto{Id: strconv.Itoa(int(info.Id)),Score: float64(info.Confidence)*100,Rects: rectFormat(info.RcHuman), Type: "track",Feature: base64.StdEncoding.EncodeToString(b)},structure.SourcePhoto{}} arg.Photo = append(arg.Photo, photoMap) } args.Sdkdata = append(args.Sdkdata, &arg) @@ -243,7 +246,7 @@ for _, info := range faceParam.Faces { percent := ruleserver.PgsInterPercent(Rect2Point(photomap.Rects),rectFormat(info.Pos.RcFace), 1, 1) if percent > 99 { - photomap.AttachObj = structure.SourcePhoto{Id:strconv.Itoa(int(info.Pos.FaceID)),Rects: rectFormat(info.Pos.RcFace),Score: float64(info.Pos.FAngle.Confidence * 100), Type: "face", ThftRes: *(info.Result), Feature: info.Feats} + photomap.AttachObj = structure.SourcePhoto{Id:strconv.Itoa(int(info.Pos.FaceID)),Rects: rectFormat(info.Pos.RcFace),Score: float64(info.Pos.FAngle.Confidence * 100), Type: "face", ThftRes: *(info.Result), Feature: base64.StdEncoding.EncodeToString(info.Feats)} } } } -- Gitblit v1.8.0