New file |
| | |
| | | photoUrl: "http://192.168.1.182:6333/submit" |
| | |
| | | basic.com/valib/gosdk.git v0.0.0-20190531034110-0062fdaaa05a // indirect |
| | | github.com/Microsoft/go-winio v0.4.12 // indirect |
| | | github.com/ajg/form v1.5.1 // indirect |
| | | github.com/go-yaml/yaml v2.1.0+incompatible |
| | | github.com/gogo/protobuf v1.2.1 |
| | | github.com/golang/protobuf v1.3.1 |
| | | github.com/gorilla/websocket v1.4.0 // indirect |
| | |
| | | github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= |
| | | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= |
| | | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= |
| | | github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o= |
| | | github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= |
| | | github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= |
| | | github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= |
| | | github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= |
| | |
| | | "encoding/json" |
| | | "errors" |
| | | "fmt" |
| | | "io/ioutil" |
| | | "net" |
| | | "ruleprocess/cache" |
| | | "ruleprocess/logger" |
| | |
| | | "github.com/satori/go.uuid" |
| | | "ruleprocess/ruleserver" |
| | | "ruleprocess/util" |
| | | "github.com/go-yaml/yaml" |
| | | ) |
| | | var weedfsUrl string |
| | | type conf struct { |
| | | PhotoUrl string |
| | | } |
| | | func init() { |
| | | data, _ := ioutil.ReadFile("conf.yml") |
| | | c := conf{} |
| | | //把yaml形式的字符串解析成struct类型 |
| | | yaml.Unmarshal(data, &c) |
| | | weedfsUrl = c.PhotoUrl |
| | | } |
| | | |
| | | var weedfsUrl = "http://192.168.1.182:6333/submit" |
| | | // 人脸的数据结构 |
| | | type PerVideoPicture struct { |
| | | Id string `json:"id"` |
| | |
| | | func InsertToEs(msg ruleserver.ResultMsg) { |
| | | |
| | | // 直接从规则的标签数据里拿符合规则的人脸结果 |
| | | logger.Info("------------------------------------从配置文件读取的值:",weedfsUrl) |
| | | if msg.RuleResult["face"] != nil && len(msg.RuleResult["face"].([]ruleserver.Arg)) > 0 { |
| | | logger.Info("往ES插人脸数据") |
| | | for _, face := range msg.RuleResult["face"].([]ruleserver.Arg) { |