| | |
| | | for _, arg := range args { |
| | | var formula string |
| | | 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) |
| | | case "license": |
| | | formula = arg.Car.License + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("当前车牌号码小公式:", formula) |
| | | case "nColor": |
| | | formula = strconv.Itoa(int(arg.Car.NColor)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车牌颜色小公式:", formula) |
| | | case "nConfidence": |
| | | formula = strconv.Itoa(int(arg.Car.NConfidence)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("整牌可信度小公式:", formula) |
| | | case "nBright": |
| | | formula = strconv.Itoa(int(arg.Car.NBright)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车牌亮度评价小公式:", formula) |
| | | case "nDirection": |
| | | formula = strconv.Itoa(int(arg.Car.NDirection)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车牌运动方向小公式:", formula) |
| | | case "nCarBright": |
| | | formula = strconv.Itoa(int(arg.Car.NCarBright)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车的亮度小公式:", formula) |
| | | case "nCarColor": |
| | | formula = strconv.Itoa(int(arg.Car.NCarColor)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车的颜色小公式:", formula) |
| | | case "nCarLogo": |
| | | formula = strconv.Itoa(int(arg.Car.NCarLogo)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车标类型小公式:", formula) |
| | | case "nCarType": |
| | | formula = strconv.Itoa(int(arg.Car.NCarType)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车辆类型小公式:", formula) |
| | | //case "nCarModel": |
| | | // formula = strconv.Itoa(int(arg.Car.ncm)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | // logger.Info("识别成功与否小公式:", formula) |
| | | //case "nCarModelConfidence": |
| | | // formula = strconv.Itoa(int(arg.Car.NCarModelConfidence)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | // logger.Info("车型可信度小公式:", formula) |
| | | case "fVDConf": |
| | | formula = strconv.FormatFloat(arg.Score, 'f', -1, 32) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车辆置信度小公式:", formula) |
| | | case "nVehicleColor1": |
| | | formula = strconv.Itoa(int(arg.Car.NVehicleColor1)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车身主颜色小公式:", formula) |
| | | case "nVehicleColor2": |
| | | formula = strconv.Itoa(int(arg.Car.NVehicleColor2)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车身辅颜色小公式:", formula) |
| | | case "fConfidence": |
| | | formula = arg.Car.VehicleType1 + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车辆类型小公式:", formula) |
| | | case "nVehicleBright": |
| | | formula = strconv.Itoa(int(arg.Car.NVehicleBright)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车辆亮度小公式:", formula) |
| | | case "nPlateFlag": |
| | | formula = strconv.Itoa(int(arg.Car.NPlateFlag)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("识别到车牌小公式:", formula) |
| | | case "license": |
| | | formula = arg.Car.License + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车牌号码小公式:", formula) |
| | | case "nConfidence": |
| | | formula = strconv.Itoa(int(arg.Car.NConfidence)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车牌可信度小公式:", formula) |
| | | case "nColor": |
| | | formula = strconv.Itoa(int(arg.Car.NColor)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车牌颜色小公式:", formula) |
| | | case "nType": |
| | | formula = strconv.Itoa(int(arg.Car.NType)) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车牌类型小公式:", formula) |
| | | } |
| | | expression, _ := govaluate.NewEvaluableExpression(formula) // 得到数学公式 |
| | | result, _ := expression.Evaluate(nil) // 得到数学公式的结果 |
| | |
| | | //args := am.targetNum targetNum 已成所有目标的总数量,这里只算yolo的 |
| | | var num int = len(am.FilterData) |
| | | formula := strconv.Itoa(num) + " " + rule.Operator + " " + rule.SdkArgValue |
| | | logger.Info("车牌数量公式",formula) |
| | | logger.Info("车辆数量公式",formula) |
| | | expression, _ := govaluate.NewEvaluableExpression(formula) // 得到数学公式 |
| | | result, _ := expression.Evaluate(nil) // 得到数学公式的结果 |
| | | return structure.LittleRuleResult{am.SdkName, rule.RuleWithPre + " " + strconv.FormatBool(result.(bool)), rule.Sort} |