panlei
2019-11-13 1d9804998f955e7d713d24ae719c757c0be73993
ruleserver/readyDataForRule.go
@@ -3,6 +3,7 @@
import (
   "basic.com/dbapi.git"
   "basic.com/pubsub/protomsg.git"
   "basic.com/valib/logger.git"
   "encoding/json"
   "errors"
   "fmt"
@@ -13,7 +14,6 @@
   "nanomsg.org/go-mangos/transport/tcp"
   "net"
   "ruleprocess/cache"
   "ruleprocess/logger"
   "ruleprocess/structure"
   "strconv"
   "time"
@@ -236,14 +236,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 +273,7 @@
      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{}}
         arg1 := structure.Arg{obj.Id,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{},nil}
         //logger.Println("放进去的arg:-------", arg1)
         a.Args = append(a.Args, &arg1)
         a.FilterData = append(a.FilterData, &arg1)
@@ -289,8 +281,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)
}