Update docs, add godoc badge

[ci skip]
This commit is contained in:
Kagami Hiiragi
2018-07-30 19:17:01 +03:00
parent 9e6aaca584
commit 780852a237
3 changed files with 6 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
# go-face [![Build Status](https://travis-ci.org/Kagami/go-face.svg?branch=master)](https://travis-ci.org/Kagami/go-face) # go-face [![Build Status](https://travis-ci.org/Kagami/go-face.svg?branch=master)](https://travis-ci.org/Kagami/go-face) [![GoDoc](https://godoc.org/github.com/Kagami/go-face?status.svg)](https://godoc.org/github.com/Kagami/go-face)
go-face implements face recognition for Go using [dlib](http://dlib.net), a go-face implements face recognition for Go using [dlib](http://dlib.net), a
popular machine learning toolkit. popular machine learning toolkit.

View File

@@ -11,7 +11,7 @@ func (e ImageLoadError) Error() string {
return string(e) return string(e)
} }
// An Serialization is returned when provided model is corrupted. // An SerializationError is returned when provided model is corrupted.
type SerializationError string type SerializationError string
func (e SerializationError) Error() string { func (e SerializationError) Error() string {

View File

@@ -32,14 +32,16 @@ type Face struct {
} }
// Descriptor holds 128-dimensional feature vector. // Descriptor holds 128-dimensional feature vector.
type Descriptor [descrLen]float32 type Descriptor [128]float32
// New creates new face with the provided parameters. // New creates new face with the provided parameters.
func New(r image.Rectangle, d Descriptor) Face { func New(r image.Rectangle, d Descriptor) Face {
return Face{r, d} 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) { func NewRecognizer(modelDir string) (rec *Recognizer, err error) {
cModelDir := C.CString(modelDir) cModelDir := C.CString(modelDir)
defer C.free(unsafe.Pointer(cModelDir)) defer C.free(unsafe.Pointer(cModelDir))