mirror of
https://github.com/Kagami/go-face.git
synced 2025-09-26 19:51:16 +08:00
Update docs, add godoc badge
[ci skip]
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# go-face [](https://travis-ci.org/Kagami/go-face)
|
||||
# go-face [](https://travis-ci.org/Kagami/go-face) [](https://godoc.org/github.com/Kagami/go-face)
|
||||
|
||||
go-face implements face recognition for Go using [dlib](http://dlib.net), a
|
||||
popular machine learning toolkit.
|
||||
|
2
error.go
2
error.go
@@ -11,7 +11,7 @@ func (e ImageLoadError) Error() string {
|
||||
return string(e)
|
||||
}
|
||||
|
||||
// An Serialization is returned when provided model is corrupted.
|
||||
// An SerializationError is returned when provided model is corrupted.
|
||||
type SerializationError string
|
||||
|
||||
func (e SerializationError) Error() string {
|
||||
|
6
face.go
6
face.go
@@ -32,14 +32,16 @@ type Face struct {
|
||||
}
|
||||
|
||||
// Descriptor holds 128-dimensional feature vector.
|
||||
type Descriptor [descrLen]float32
|
||||
type Descriptor [128]float32
|
||||
|
||||
// New creates new face with the provided parameters.
|
||||
func New(r image.Rectangle, d Descriptor) Face {
|
||||
return Face{r, d}
|
||||
}
|
||||
|
||||
// NewRecognizer returns a new recognizer interface
|
||||
// NewRecognizer returns a new recognizer interface. modelDir points to
|
||||
// directory with shape_predictor_5_face_landmarks.dat and
|
||||
// dlib_face_recognition_resnet_model_v1.dat files.
|
||||
func NewRecognizer(modelDir string) (rec *Recognizer, err error) {
|
||||
cModelDir := C.CString(modelDir)
|
||||
defer C.free(unsafe.Pointer(cModelDir))
|
||||
|
Reference in New Issue
Block a user