| | |
| | | package db |
| | | |
| | | import ( |
| | | "encoding/base64" |
| | | "sdkCompare/compare" |
| | | "strconv" |
| | | ) |
| | | |
| | |
| | | |
| | | for _, p := range persons { |
| | | if p.FaceFeature != "" { |
| | | byteFeat, err := base64.StdEncoding.DecodeString(p.FaceFeature) |
| | | if err != nil { |
| | | continue |
| | | } |
| | | |
| | | arr = append(arr, &FeatureCacheBase{ |
| | | Id: p.Id, |
| | | TableId: p.TableId, |
| | | AreaId: p.AreaID, |
| | | FaceFeature: p.FaceFeature, |
| | | FaceFeature: compare.ByteSlice2float32Slice(byteFeat), |
| | | Enable: int32(p.Enable), |
| | | }) |
| | | } |
| | |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | |
| | | if p.FaceFeature != "" { |
| | | byteFeat, err := base64.StdEncoding.DecodeString(p.FaceFeature) |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | info = &FeatureCacheBase{ |
| | | Id: p.Id, |
| | | TableId: p.TableId, |
| | | AreaId: p.AreaID, |
| | | FaceFeature: p.FaceFeature, |
| | | FaceFeature: compare.ByteSlice2float32Slice(byteFeat), |
| | | Enable: int32(p.Enable), |
| | | } |
| | | } |