| | |
| | | logger.Debug("localConfig is wrong!!!") |
| | | return |
| | | } |
| | | var weedfsUri = "http://"+localConf.WebPicIp+":"+strconv.Itoa(int(localConf.WebPicPort))+"/submit" |
| | | var weedfsUri = "http://"+localConf.WebPicIp+":"+strconv.Itoa(int(localConf.WebPicPort))+"/submit?collection=persistent" |
| | | logger.Debug("weedfsUri:",weedfsUri) |
| | | resultMap :=make(map[string]interface{},0) |
| | | //将上传的图片交人脸检测和人脸提取,获得特征 |
| | |
| | | PicDate string `json:"picDate"` |
| | | Content string `json:"content"` |
| | | IsAlarm bool `json:"isAlarm"` |
| | | PicMaxUrl string `json:"picMaxUrl"` |
| | | PicSmUrl []string `json:"picSmUrl"` |
| | | PicMaxUrl []string `json:"picMaxUrl"` |
| | | TargetInfo []TargetInfo `json:"targetInfo"` |
| | | TaskId string `json:"taskId"` |
| | | TaskName string `json:"taskName"` |
| | |
| | | |
| | | type TargetInfo struct { |
| | | TargetId string `json:"targetId"` |
| | | TargetType string `json:"targetType"` |
| | | TargetScore float64 `json:"targetScore"` |
| | | Feature string `json:"feature"` |
| | | PicSmUrl string `json:"picSmUrl"` |
| | |
| | | } |
| | | |
| | | type DbPersonVo struct { |
| | | TableId string `json:"tableId"` |
| | | TableName string `json:"tableName"` |
| | | BwType string `json:"bwType"` |
| | | CompareScore float64 `json:"compareScore"` |
| | | MonitorLevel string `json:"monitorLevel"` |
| | | TargetId string `json:"targetId"` |
| | | TargetName string `json:"targetName"` |
| | | TargetPicUrl string `json:"targetPicUrl"` |
| | | MonitorLevel string `json:"monitorLevel"` |
| | | Labels string `json:"labels"` |
| | | TableId string `json:"tableId"` |
| | | TableName string `json:"tableName"` |
| | | Content string `json:"content"` |
| | | Enable int32 `json:"enable"` |
| | | } |
| | | |
| | |
| | | MonitorLevel: p.MonitorLevel, |
| | | TargetName: p.PersonName, |
| | | TargetPicUrl: p.PersonPicUrl, |
| | | Labels: p.Sex+" / "+p.IdCard+" / "+p.IdCard, |
| | | Labels: p.PhoneNum+"/"+p.Sex+"/"+p.IdCard, |
| | | TableId: p.TableId, |
| | | Content: p.Reserved, |
| | | Enable: p.Enable, |
| | | } |
| | | dbTableInfos, _ := dtApi.DbtablesById([]string{ p.TableId }) |
| | |
| | | bi = append(bi, DbPersonVo{ |
| | | TargetId: p.TargetId, |
| | | CompareScore: util.ParseScore64(p.CompareScore), |
| | | MonitorLevel: parseMonitorLevel(p.MonitorLevel), |
| | | MonitorLevel: p.MonitorLevel, |
| | | TargetName: p.TargetName, |
| | | TargetPicUrl: p.TargetPicUrl, |
| | | Labels: p.Labels, |
| | |
| | | } |
| | | tInfo := TargetInfo{ |
| | | TargetId: vti.TargetId, |
| | | TargetType: vti.TargetType, |
| | | TargetScore: vti.TargetScore, |
| | | Feature: vti.Feature, |
| | | PicSmUrl: vti.PicSmUrl, |
| | |
| | | logger.Debug("localConfig is wrong!!!") |
| | | return nil,"",nil,errors.New("localConf err") |
| | | } |
| | | var weedfsUri = "http://"+localConf.WebPicIp+":"+strconv.Itoa(int(localConf.WebPicPort))+"/submit" |
| | | var weedfsUri = "http://"+localConf.WebPicIp+":"+strconv.Itoa(int(localConf.WebPicPort))+"/submit?collection=persistent" |
| | | logger.Debug("weedfsUri:",weedfsUri) |
| | | faceArr, err, pI := service.GetFaceFeaFromSdk(fileBytes, time.Second*60) |
| | | if err ==nil && len(faceArr) ==1 { |
| | |
| | | logger.Debug("localConfig is wrong!!!") |
| | | return |
| | | } |
| | | var weedfsUri = "http://"+localConf.WebPicIp+":"+strconv.Itoa(int(localConf.WebPicPort))+"/submit" |
| | | var weedfsUri = "http://"+localConf.WebPicIp+":"+strconv.Itoa(int(localConf.WebPicPort))+"/submit?collection=persistent" |
| | | |
| | | //将上传的图片交人脸检测和人脸提取,获得特征 |
| | | fileBytes, _ := ioutil.ReadAll(file) |
| | |
| | | logger.Debug("localConfig is wrong!!!") |
| | | return "",nil,err2 |
| | | } |
| | | var weedfsUri = "http://"+localConf.WebPicIp+":"+strconv.Itoa(int(localConf.WebPicPort))+"/submit" |
| | | var weedfsUri = "http://"+localConf.WebPicIp+":"+strconv.Itoa(int(localConf.WebPicPort))+"/submit?collection=persistent" |
| | | //根据人脸坐标扣出人脸小图 |
| | | t1 := time.Now() |
| | | cutFaceImgData := util.SubImg(*pI, int(rcFace.Left), int(rcFace.Top), int(rcFace.Right), int(rcFace.Bottom)) |
| | |
| | | logger.Debug("localConfig is wrong!!!") |
| | | return |
| | | } |
| | | var weedfsUri = "http://"+localConf.WebPicIp+":"+strconv.Itoa(int(localConf.WebPicPort))+"/submit" |
| | | var weedfsUri = "http://"+localConf.WebPicIp+":"+strconv.Itoa(int(localConf.WebPicPort))+"/submit?collection=persistent" |
| | | { |
| | | uri := weedfsUri |
| | | fileInfo, e := esutil.PostFormBufferData(uri, filename, "file", uploadData) |