zhangzengfei
2024-09-26 88b1f1d1d14a8fe9e3dde2f363a89d821fc0e641
compare/faceSdk.go
@@ -1,7 +1,7 @@
package compare
import (
   "unsafe"
   "sdkCompare/util"
)
// #if FEATURE_NORMALIZE
@@ -84,8 +84,8 @@
}
func DecCompare(feat1, feat2 []byte) float32 {
   ffeat1 := ByteSlice2float32Slice(feat1)
   ffeat2 := ByteSlice2float32Slice(feat2)
   ffeat1 := util.ByteSlice2float32Slice(feat1)
   ffeat2 := util.ByteSlice2float32Slice(feat2)
   if len(feat1) != len(feat2) {
      return 0
   }
@@ -105,15 +105,4 @@
   }
   //fmt.Println("score:", score)
   return score
}
func ByteSlice2float32Slice(src []byte) []float32 {
   if len(src) == 0 {
      return nil
   }
   l := len(src) / 4
   ptr := unsafe.Pointer(&src[0])
   return (*[1 << 26]float32)((*[1 << 26]float32)(ptr))[:l:l]
}