panlei
2019-11-13 732d0c9d92acde9b4de607f511af1d0e7500f3cb
ruleserver/readyDataForRule.go
@@ -3,17 +3,18 @@
import (
   "basic.com/dbapi.git"
   "basic.com/pubsub/protomsg.git"
   "basic.com/valib/logger.git"
   "encoding/json"
   "errors"
   "fmt"
   "github.com/golang/protobuf/proto"
   uuid "github.com/satori/go.uuid"
   "math"
   "nanomsg.org/go-mangos"
   "nanomsg.org/go-mangos/protocol/req"
   "nanomsg.org/go-mangos/transport/tcp"
   "net"
   "ruleprocess/cache"
   "ruleprocess/logger"
   "ruleprocess/structure"
   "strconv"
   "time"
@@ -236,14 +237,6 @@
                     //logger.Info("--------------看看compareFlag的值和tableId和areaMap.args的长度:",compareFlag,tableIds,len(areaMap.args))
                     for _, arg := range areaMap.Args {
                        arg.Liker = arg.Liker[0:0]
                        //logger.Info("清空之后看看之前打的人脸标签变了没:")
                        //if args.RuleResult["face"] != nil && len(args.RuleResult["face"].([]FaceResult)) > 0 {
                        //   for _, faceResult := range args.RuleResult["face"].([]FaceResult) {
                        //      for _,arg := range faceResult.Args {
                        //         logger.Info("人员分值是:",arg.Score,"liker的数量为",arg.Liker)
                        //      }
                        //   }
                        //}
                        if compareFlag == 1 {
                           fillLiker(nil, threshold, arg)
                        }
@@ -281,7 +274,8 @@
      if  obj.Score >= threshold && float64(obj.Rects.Width*obj.Rects.Height) >= size && PgsInterPercent(areaPoints, obj.Rects, widthScale, heigthScale) >= intersectionper {
         // 这步要备齐表达式里所需要的所有参数
         a.TargetNum++
         arg1 := structure.Arg{obj.Id,obj.Score, PgsInterPercent(areaPoints, obj.Rects, widthScale, heigthScale), float64(obj.Rects.Width * obj.Rects.Height), obj.IsYolo, obj.Rects, obj.Feature, obj.ThftRes, []*structure.BaseInfo{}}
         uuid := uuid.NewV4().String()
         arg1 := structure.Arg{obj.Id,uuid,obj.Score, PgsInterPercent(areaPoints, obj.Rects, widthScale, heigthScale), float64(obj.Rects.Width * obj.Rects.Height), a.AreaJson,obj.IsYolo, obj.Rects, obj.Feature, obj.ThftRes, []*structure.BaseInfo{},structure.ResultMsg{}}
         //logger.Println("放进去的arg:-------", arg1)
         a.Args = append(a.Args, &arg1)
         a.FilterData = append(a.FilterData, &arg1)
@@ -289,8 +283,6 @@
   }
   logger.Info("区域是:",areaPoints,"区域内目标数量为:",a.TargetNum,"---",len(a.FilterData))
   a.Time = time.Unix(time.Now().Unix(), 0).String()[11:16]
   a.KeepRight = arg.KeepRight
   a.IsStatic = arg.IsStatic
   //logger.Println("--------------------看看区域数据:",*a)
}