panlei
2019-11-18 18827e9e25797b6d24ad7ad4785f7e80fe46a409
algorithm/face/face.go
@@ -64,15 +64,16 @@
                  //logger.Info("-----------------------人脸过滤的args里的数量:", len(args))
                  for _, arg := range args {
                     var formula string
                     if rule.SdkArgAlias == "score" {
                        formula = strconv.FormatFloat(arg.Score, 'f', -1, 64) + " " + rule.Operator + " " + rule.SdkArgValue // 得到字符串公式
                        logger.Info("当前相似度小公式:", formula)
                     } else if rule.SdkArgAlias == "proportion" {
                        formula = strconv.FormatFloat(arg.Proportion, 'f', -1, 64) + " " + rule.Operator + " " + rule.SdkArgValue // 得到字符串公式
                        logger.Info("当前占比小公式:", formula)
                     } else {
                        formula = strconv.FormatFloat(arg.Size, 'f', -1, 64) + " " + rule.Operator + " " + rule.SdkArgValue // 得到字符串公式
                        logger.Info("当前尺寸小公式:", formula)
                     switch rule.SdkArgAlias {
                     case "score":
                        formula = strconv.FormatFloat(arg.Score, 'f', -1, 64) + " " + rule.Operator + " " + rule.SdkArgValue
                        logger.Info("相似度小公式:", formula)
                     case "proportion":
                        formula = strconv.FormatFloat(arg.Proportion, 'f', -1, 64) + " " + rule.Operator + " " + rule.SdkArgValue
                        logger.Info("占比公式:", formula)
                     case "size":
                        formula = strconv.FormatFloat(arg.Size, 'f', -1, 64) + " " + rule.Operator + " " + rule.SdkArgValue
                        logger.Info("尺寸小公式:", formula)
                     }
                     expression, _ := govaluate.NewEvaluableExpression(formula) // 得到数学公式
                     result, _ := expression.Evaluate(nil)                      // 得到数学公式的结果