From 1095c312c7cb3c49534f3bdf43daadc42f0f749a Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期四, 07 十一月 2024 17:07:36 +0800
Subject: [PATCH] fix build
---
compare/faceSdk.go | 17 +++--------------
1 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/compare/faceSdk.go b/compare/faceSdk.go
index 49fa258..8ed054d 100644
--- a/compare/faceSdk.go
+++ b/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]
}
--
Gitblit v1.8.0