zhangzengfei
2024-03-26 345b16523c34672e6283a6928d857c406cc6fec3
更换人脸比对算法
54个文件已删除
1个文件已添加
3个文件已修改
5564 ■■■■■ 已修改文件
cache/compare.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cache/faceCompare.go 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/cface.h 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/faceCompare.go 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/goface.go 433 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/CMakeLists.txt 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeCache.txt 508 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/3.5.1/CMakeCCompiler.cmake 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/3.5.1/CMakeCXXCompiler.cmake 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_C.bin 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_CXX.bin 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/3.5.1/CMakeSystem.cmake 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/3.5.1/CompilerIdC/CMakeCCompilerId.c 544 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/3.5.1/CompilerIdC/a.out 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/3.5.1/CompilerIdCXX/CMakeCXXCompilerId.cpp 533 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/3.5.1/CompilerIdCXX/a.out 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/CMakeDirectoryInformation.cmake 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/CMakeError.log 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/CMakeOutput.log 582 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/Makefile.cmake 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/Makefile2 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/TargetDirectories.txt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/cmake.check_cache 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/feature_tests.bin 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/feature_tests.c 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/feature_tests.cxx 405 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/progress.marks 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/wface.dir/CXX.includecache 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/wface.dir/DependInfo.cmake 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/wface.dir/build.make 141 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/wface.dir/cface.cpp.o 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/wface.dir/cmake_clean.cmake 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/wface.dir/csrc/face.cpp.o 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/wface.dir/depend.internal 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/wface.dir/depend.make 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/wface.dir/flags.make 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/wface.dir/link.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/CMakeFiles/wface.dir/progress.make 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/Makefile 208 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/cmake_install.cmake 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/build/libwface.so 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/cface.cpp 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/cface.h 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/csrc/face.cpp 225 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/csrc/face.h 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/csrc/struct.h 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/sdk/include/FiStdDefEx.h 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/sdk/include/THFaceImage_i.h 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/sdk/include/THFaceLive_i.h 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/sdk/include/THFaceProperty_i.h 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/sdk/include/THFaceTracking_i.h 195 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/sdk/include/THFeature_i.h 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libface/sdk/readme.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/libs/libwface.so 补丁 | 查看 | 原始文档 | blame | 历史
face/readme.txt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
face/struct.h 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
go.mod 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cache/compare.go
@@ -5,6 +5,7 @@
    "errors"
    "flag"
    "fmt"
    "sdkCompare/face"
    "strconv"
    "strings"
    "sync"
@@ -544,7 +545,6 @@
}
func DoSdkCompare(ci []byte, co string) float32 {
    co_d, err := base64.StdEncoding.DecodeString(co)
    if err != nil {
        logger.Error("DoSdkCompare err:", err)
@@ -559,7 +559,7 @@
    //    logger.Error("source fea.len !=2560")
    //    return -1
    //}
    sec := DecCompare(ci, co_d)
    sec := face.DecCompare(ci, co_d)
    //logger.Debug("比对得分为:", sec)
    sec = ParseScore(sec)
cache/faceCompare.go
File was deleted
face/cface.h
File was deleted
face/faceCompare.go
New file
@@ -0,0 +1,37 @@
package face
import (
    "unsafe"
)
func DecCompare(feat1 []byte, feat2 []byte) float32 {
    ffeat1 := byteSlice2float32Slice(feat1)
    ffeat2 := byteSlice2float32Slice(feat2)
    if len(ffeat1) != len(ffeat2) {
        return 0
    }
    // normalize
    var score float32
    for i := 0; i < len(ffeat1); i++ {
        score += ffeat1[i] * ffeat2[i]
    }
    score += 0.05
    if score > 0.9999 {
        score = 0.9999
    }
    if score < 0.0001 {
        score = 0.0001
    }
    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)(ptr)[:l:l]
}
face/goface.go
File was deleted
face/libface/CMakeLists.txt
File was deleted
face/libface/build/CMakeCache.txt
File was deleted
face/libface/build/CMakeFiles/3.5.1/CMakeCCompiler.cmake
File was deleted
face/libface/build/CMakeFiles/3.5.1/CMakeCXXCompiler.cmake
File was deleted
face/libface/build/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_C.bin
Binary files differ
face/libface/build/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_CXX.bin
Binary files differ
face/libface/build/CMakeFiles/3.5.1/CMakeSystem.cmake
File was deleted
face/libface/build/CMakeFiles/3.5.1/CompilerIdC/CMakeCCompilerId.c
File was deleted
face/libface/build/CMakeFiles/3.5.1/CompilerIdC/a.out
Binary files differ
face/libface/build/CMakeFiles/3.5.1/CompilerIdCXX/CMakeCXXCompilerId.cpp
File was deleted
face/libface/build/CMakeFiles/3.5.1/CompilerIdCXX/a.out
Binary files differ
face/libface/build/CMakeFiles/CMakeDirectoryInformation.cmake
File was deleted
face/libface/build/CMakeFiles/CMakeError.log
File was deleted
face/libface/build/CMakeFiles/CMakeOutput.log
File was deleted
face/libface/build/CMakeFiles/Makefile.cmake
File was deleted
face/libface/build/CMakeFiles/Makefile2
File was deleted
face/libface/build/CMakeFiles/TargetDirectories.txt
File was deleted
face/libface/build/CMakeFiles/cmake.check_cache
File was deleted
face/libface/build/CMakeFiles/feature_tests.bin
Binary files differ
face/libface/build/CMakeFiles/feature_tests.c
File was deleted
face/libface/build/CMakeFiles/feature_tests.cxx
File was deleted
face/libface/build/CMakeFiles/progress.marks
File was deleted
face/libface/build/CMakeFiles/wface.dir/CXX.includecache
File was deleted
face/libface/build/CMakeFiles/wface.dir/DependInfo.cmake
File was deleted
face/libface/build/CMakeFiles/wface.dir/build.make
File was deleted
face/libface/build/CMakeFiles/wface.dir/cface.cpp.o
Binary files differ
face/libface/build/CMakeFiles/wface.dir/cmake_clean.cmake
File was deleted
face/libface/build/CMakeFiles/wface.dir/csrc/face.cpp.o
Binary files differ
face/libface/build/CMakeFiles/wface.dir/depend.internal
File was deleted
face/libface/build/CMakeFiles/wface.dir/depend.make
File was deleted
face/libface/build/CMakeFiles/wface.dir/flags.make
File was deleted
face/libface/build/CMakeFiles/wface.dir/link.txt
File was deleted
face/libface/build/CMakeFiles/wface.dir/progress.make
File was deleted
face/libface/build/Makefile
File was deleted
face/libface/build/cmake_install.cmake
File was deleted
face/libface/build/libwface.so
Binary files differ
face/libface/cface.cpp
File was deleted
face/libface/cface.h
File was deleted
face/libface/csrc/face.cpp
File was deleted
face/libface/csrc/face.h
File was deleted
face/libface/csrc/struct.h
File was deleted
face/libface/sdk/include/FiStdDefEx.h
File was deleted
face/libface/sdk/include/THFaceImage_i.h
File was deleted
face/libface/sdk/include/THFaceLive_i.h
File was deleted
face/libface/sdk/include/THFaceProperty_i.h
File was deleted
face/libface/sdk/include/THFaceTracking_i.h
File was deleted
face/libface/sdk/include/THFeature_i.h
File was deleted
face/libface/sdk/readme.txt
File was deleted
face/libs/libwface.so
Binary files differ
face/readme.txt
File was deleted
face/struct.h
File was deleted
go.mod
@@ -21,6 +21,7 @@
    github.com/natefinch/lumberjack v2.0.0+incompatible // indirect
    github.com/smartystreets/goconvey v1.8.1 // indirect
    github.com/spf13/viper v1.8.1
    google.golang.org/protobuf v1.26.0
    gorm.io/driver/mysql v1.5.2
    gorm.io/gorm v1.25.6
    nanomsg.org/go-mangos v1.4.0
main.go
@@ -58,10 +58,6 @@
    }
    cache.InitDbTablePersons()
    if !cache.InitCompare() {
        logger.Debug("init SDKFace return false,panic")
        return
    }
    serveUrl = serveUrl + strconv.Itoa(config.DbPersonCompInfo.ServePort)
    //if procName == "dbCompare" {