| | |
| | | |
| | | import ( |
| | | "basic.com/valib/logger.git" |
| | | "ruleprocess/structure" |
| | | "encoding/base64" |
| | | "encoding/json" |
| | | "errors" |
| | | "net" |
| | | "ruleprocess/cache" |
| | | "ruleprocess/structure" |
| | | "strconv" |
| | | "time" |
| | | |
| | |
| | | IsCollect int `json:"isCollect"` |
| | | IsDelete int `json:"isDelete"` |
| | | BaseInfo []*structure.BaseInfo `json:"baseInfo"` |
| | | TargetInfo Target |
| | | } |
| | | |
| | | type Target struct { |
| | | TargetId string `json:"targetId"` |
| | | TargetScore float64 `json:"targetScore"` |
| | | TargetLocation Points |
| | | } |
| | | |
| | | type Points struct { |
| | | TopLeft Point `json:"topLeft"` |
| | | BottomRight Point `json:"bottomRight"` |
| | | } |
| | | |
| | | type Point struct { |
| | | Lat float64 `json:"lat"` |
| | | Lon float64 `json:"lon"` |
| | | } |
| | | // yolo行为的数据结构 |
| | | type Personaction struct { |
| | | Id string `json:"id"` |
| | |
| | | if linkId != "" { |
| | | linksId = linkId |
| | | } |
| | | var target = new(Target) |
| | | target.TargetId = strconv.FormatUint(face.Id, 10) |
| | | target.TargetScore = face.Score |
| | | target.TargetLocation = Points{TopLeft:Point{face.Location.X,face.Location.Y},BottomRight:Point{face.Location.X+face.Location.Width,face.Location.Y+face.Location.Height}} |
| | | //logger.Info("人脸的id:",strconv.FormatUint(face.Id, 10)) |
| | | //logger.Info("人脸的分值:",face.Score) |
| | | pervideo := PerVideoPicture{ |
| | |
| | | 0, |
| | | 0, |
| | | face.Liker, |
| | | *target, |
| | | } |
| | | requstbody, err := json.Marshal(pervideo) |
| | | |