From 1570637a67ec0849dbe53cff570c8691a9cff49b Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期一, 16 十二月 2019 13:55:26 +0800
Subject: [PATCH] arg新加一个参数
---
algorithm/personTrack/personTrack.go | 4 ++--
algorithm/middleware/readyData.go | 4 ++--
structure/rule.go | 46 +++++++++++++++++++++++++---------------------
3 files changed, 29 insertions(+), 25 deletions(-)
diff --git a/algorithm/middleware/readyData.go b/algorithm/middleware/readyData.go
index 8a31d50..a25f62d 100644
--- a/algorithm/middleware/readyData.go
+++ b/algorithm/middleware/readyData.go
@@ -35,7 +35,7 @@
// 杩欐瑕佸榻愯〃杈惧紡閲屾墍闇�瑕佺殑鎵�鏈夊弬鏁�
a.TargetNum++
uuid := uuid.NewV4().String()
- arg1 := structure.Arg{structure.SourceArg{obj.Id,uuid,obj.Score, ruleserver.PgsInterPercent(areaPoints, obj.Rects, widthScale, heigthScale), float64(obj.Rects.Width * obj.Rects.Height), a.AreaJson,obj.Type, obj.Rects, obj.Car,obj.Feature,obj.ThftRes, []*structure.BaseInfo{},"",structure.ResultMsg{}},structure.SourceArg{}}
+ arg1 := structure.Arg{structure.SourceArg{obj.Id,uuid,obj.Score, ruleserver.PgsInterPercent(areaPoints, obj.Rects, widthScale, heigthScale), float64(obj.Rects.Width * obj.Rects.Height), a.AreaJson,obj.Type, obj.Rects, obj.Car,obj.Feature,obj.BodyFeature,obj.ThftRes, []*structure.BaseInfo{},"",structure.ResultMsg{}},structure.SourceArg{}}
//logger.Println("鏀捐繘鍘荤殑arg锛�-------", arg1)
a.Args = append(a.Args, &arg1)
a.FilterData = append(a.FilterData, &arg1)
@@ -220,7 +220,7 @@
}
for _, info := range Track.Result {
logger.Info("鎺ユ敹璺熻釜鏁版嵁锛�",info.Id,info.Confidence,info.Feature)
- photoMap := structure.PhotoMap{structure.SourcePhoto{Id: strconv.Itoa(int(info.Id)),Score: float64(info.Confidence)*100,Rects: rectFormat(info.RcHuman), Type: "track"},structure.SourcePhoto{}}
+ photoMap := structure.PhotoMap{structure.SourcePhoto{Id: strconv.Itoa(int(info.Id)),Score: float64(info.Confidence)*100,Rects: rectFormat(info.RcHuman), Type: "track",BodyFeature: info.Feature},structure.SourcePhoto{}}
arg.Photo = append(arg.Photo, photoMap)
}
args.Sdkdata = append(args.Sdkdata, &arg)
diff --git a/algorithm/personTrack/personTrack.go b/algorithm/personTrack/personTrack.go
index e27318b..29a0298 100644
--- a/algorithm/personTrack/personTrack.go
+++ b/algorithm/personTrack/personTrack.go
@@ -101,7 +101,7 @@
trackArg["esId"] = esId
trackArg["threshold"] = compareThreshold
trackArg["cameraId"] = am.CameraId
- trackArg["bodyFeature"] = arg.Feature
+ trackArg["bodyFeature"] = arg.BodyFeature
trackArg["faceFeature"] = arg.AttachArg.Feature
logger.Info("璇锋眰寮犲椋炴瘮瀵规暟鎹弬鏁帮細",trackArg)
b,err := json.Marshal(trackArg)
@@ -120,7 +120,7 @@
}
func track (rule *protomsg.Rule,am *structure.AreaMap) structure.LittleRuleResult{
- var threshold float32 = 70 // 榛樿闃堝�间负70
+ var threshold float32 = 60 // 榛樿闃堝�间负70
if th,err := strconv.ParseFloat(rule.SdkArgValue,32); err == nil {
threshold = float32(th)
}
diff --git a/structure/rule.go b/structure/rule.go
index a6fe8d5..3479096 100644
--- a/structure/rule.go
+++ b/structure/rule.go
@@ -6,26 +6,28 @@
// 姣忎釜鐩爣鐨勫弬鏁帮細鐩镐技搴︼紝鍗犳瘮锛屽昂瀵�
type SourceArg struct {
- Id string
- Uuid string
- Score float64 // 鍖哄煙鍐呯殑鐩爣鐨勭浉浼煎害
- Proportion float64 // 鍖哄煙鍐呯殑鐩爣鐨勫崰姣�
- Size float64 // 鍖哄煙鍐呯殑鐩爣鐨勫昂瀵�
- AreaJson string // 鎵�灞炲尯鍩�
- Type string // 璁拌浇鏁版嵁绫诲瀷
- Location Rect // 璁颁笅姣忎釜鐩爣鐨勪綅缃弬鏁帮紝鏈�鍚庣粰缁撴灉瑁呴厤鐩爣鏁版嵁鐨勬椂鍊欑敤鐨勫埌
- Car *protomsg.PlateIDVehicle // 杞﹁締鍙傛暟
- Feature []byte
- ThftRes protomsg.ThftResult
- Liker []*BaseInfo
- TimeLable string
- CacheData ResultMsg
+ Id string
+ Uuid string
+ Score float64 // 鍖哄煙鍐呯殑鐩爣鐨勭浉浼煎害
+ Proportion float64 // 鍖哄煙鍐呯殑鐩爣鐨勫崰姣�
+ Size float64 // 鍖哄煙鍐呯殑鐩爣鐨勫昂瀵�
+ AreaJson string // 鎵�灞炲尯鍩�
+ Type string // 璁拌浇鏁版嵁绫诲瀷
+ Location Rect // 璁颁笅姣忎釜鐩爣鐨勪綅缃弬鏁帮紝鏈�鍚庣粰缁撴灉瑁呴厤鐩爣鏁版嵁鐨勬椂鍊欑敤鐨勫埌
+ Car *protomsg.PlateIDVehicle // 杞﹁締鍙傛暟
+ Feature []byte
+ BodyFeature []float32
+ ThftRes protomsg.ThftResult
+ Liker []*BaseInfo
+ TimeLable string
+ CacheData ResultMsg
}
type Arg struct {
SourceArg
AttachArg SourceArg
}
+
// 姣忎釜鍖哄煙鍐呯殑鍥剧墖鏁版嵁闆嗗悎
type AreaMap struct {
CameraId string
@@ -46,14 +48,16 @@
}
type SourcePhoto struct {
- Id string
- Rects Rect // 鐭╁舰鍖哄煙鍙傛暟
- Score float64 // 鐩镐技搴﹀緱鍒嗭紙鏈夊澶х▼搴﹀儚涓�涓洰鏍囥�備汉鑴革紝浜轰綋鎴栬溅绛夌瓑锛�
- Type string // 璁拌浇鏁版嵁绫诲瀷
- ThftRes protomsg.ThftResult
- Feature []byte
- Car *protomsg.PlateIDVehicle
+ Id string
+ Rects Rect // 鐭╁舰鍖哄煙鍙傛暟
+ Score float64 // 鐩镐技搴﹀緱鍒嗭紙鏈夊澶х▼搴﹀儚涓�涓洰鏍囥�備汉鑴革紝浜轰綋鎴栬溅绛夌瓑锛�
+ Type string // 璁拌浇鏁版嵁绫诲瀷
+ ThftRes protomsg.ThftResult
+ Feature []byte
+ BodyFeature []float32
+ Car *protomsg.PlateIDVehicle
}
+
// sdk杈撳嚭鐨勫浘鐗囦笂鍗曚釜鐩爣鐨勬暟鎹�
type PhotoMap struct {
SourcePhoto
--
Gitblit v1.8.0