add face recognition

This commit is contained in:
2025-01-22 10:36:28 +08:00
parent eab806fb9b
commit c6af9a0461
47 changed files with 3621 additions and 454 deletions

View File

@@ -0,0 +1,24 @@
package face_recognizer
import (
"github.com/Kagami/go-face"
"os"
"path/filepath"
)
// NewFaceRecognition creates a new instance of FaceRecognition
func NewFaceRecognition() *face.Recognizer {
dir, err := os.Getwd()
if err != nil {
panic(err)
return nil
}
modelDir := filepath.Join(dir, "/resources/models/face")
rec, err := face.NewRecognizer(modelDir)
if err != nil {
panic(err)
return nil
}
//defer rec.Close()
return rec
}