| | |
| | | "basic.com/pubsub/cache.git/shardmap" |
| | | |
| | | "basic.com/valib/gosdk.git" |
| | | "basic.com/pubsub/cache.git" |
| | | ) |
| | | |
| | | var querynum = flag.Int("querynum", 10, "the query number from database") |
| | |
| | | fmt.Println() |
| | | } |
| | | |
| | | func GetComparePersonBaseInfo(tableid []string, faceFeature []byte, compareThreshold int) []byte { |
| | | func GetComparePersonBaseInfo(tableid []string, faceFeature []byte, compareThreshold float32) []byte { |
| | | |
| | | totalmap := make(map[string]float32) |
| | | |
| | |
| | | |
| | | if tableid == nil { |
| | | //对比全部 |
| | | for _, val := range cache.Cmap.Cam { |
| | | for _, val := range Cmap.Cam { |
| | | tmpmap := val.Walk(Printest, faceFeature) |
| | | for key, sec := range tmpmap { |
| | | if sec > 70*0.01 { |
| | | if sec > 50*0.01 { |
| | | fmt.Println("map为",totalmap[key],sec) |
| | | totalmap[key] = sec |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | for _, tid := range tableid { |
| | | shardins, ok := cache.Cmap.Cam[tid] |
| | | shardins, ok := Cmap.Cam[tid] |
| | | fmt.Println(ok) |
| | | if !ok { |
| | | fmt.Println("get shad error by id", shardins) |
| | |
| | | } |
| | | tmpmap := shardins.Walk(Printest, faceFeature) |
| | | for key, sec := range tmpmap { |
| | | if compareThreshold > 70{ |
| | | if compareThreshold > 50*0.01{ |
| | | if sec > compareThreshold { |
| | | fmt.Println("map为",totalmap[key],sec) |
| | | totalmap[key] = sec |
| | | } |
| | | }else { |
| | | if sec > 70*0.01 { |
| | | if sec > 50*0.01 { |
| | | fmt.Println("map为",totalmap[key],sec) |
| | | totalmap[key] = sec |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | sec := gosdk.FaceCompare(ci, co_d) |
| | | fmt.Println("比对得分为:",sec) |
| | | return sec |
| | | } |