From 2d0ec0a2d038f962648f4b5acaea892113ac112f Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期三, 13 十一月 2019 17:04:34 +0800
Subject: [PATCH] --
---
ruleserver/readyDataForRule.go | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/ruleserver/readyDataForRule.go b/ruleserver/readyDataForRule.go
index 8dab014..b0fcee6 100644
--- a/ruleserver/readyDataForRule.go
+++ b/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"
@@ -123,14 +124,14 @@
// 灏嗗瓧绗︿覆鏍煎紡鐨勫潗鏍囧簭鍒楀寲涓篜oint鏍煎紡
-func Json2points(areaPoints string) []structure.Point {
- var pts []structure.Point
+func Json2points(areaPoints string) []Point {
+ var pts []Point
if areaPoints == "[]" || areaPoints == "" {
logger.Error("=====================姝ゅ尯鍩熶负鍏ㄩ儴鍖哄煙")
- pts = append(pts, structure.Point{0, 0})
- pts = append(pts, structure.Point{0, 540})
- pts = append(pts, structure.Point{960, 540})
- pts = append(pts, structure.Point{960, 0})
+ pts = append(pts, Point{0, 0})
+ pts = append(pts, Point{0, 540})
+ pts = append(pts, Point{960, 540})
+ pts = append(pts, Point{960, 0})
} else {
err := json.Unmarshal([]byte(areaPoints), &pts)
if err != nil {
@@ -281,7 +282,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), obj.IsYolo, obj.Rects, obj.Feature, obj.ThftRes, []*structure.BaseInfo{}}
//logger.Println("鏀捐繘鍘荤殑arg锛�-------", arg1)
a.Args = append(a.Args, &arg1)
a.FilterData = append(a.FilterData, &arg1)
--
Gitblit v1.8.0