zhangzengfei
2024-04-18 bdcc9624341ee34298be74a706b09f12f8306456
db/person.go
@@ -1,6 +1,8 @@
package db
import (
   "encoding/base64"
   "sdkCompare/compare"
   "strconv"
)
@@ -55,11 +57,16 @@
   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),
         })
      }
@@ -74,12 +81,17 @@
   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),
      }
   }