Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDistance ¶
func GetDistance(a, b Descriptor) float64
Types ¶
type Face ¶
type Face struct { Rectangle image.Rectangle Descriptor Descriptor }
Face holds coordinates and descriptor of the human face.
type ImageLoadError ¶
type ImageLoadError string
An ImageLoadError is returned when provided image file is corrupted.
func (ImageLoadError) Error ¶
func (e ImageLoadError) Error() string
type Recognizer ¶
type Recognizer struct {
// contains filtered or unexported fields
}
A Recognizer creates face descriptors for provided images and classifies them into categories.
func NewRecognizer ¶
func NewRecognizer(modelDir string) (rec *Recognizer, err error)
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 (*Recognizer) Close ¶
func (rec *Recognizer) Close()
Close frees resources taken by the Recognizer. Safe to call multiple times. Don't use Recognizer after close call.
func (*Recognizer) Recognize ¶
func (rec *Recognizer) Recognize(imgData []byte, width, height int, maxFaces int) (faces []Face, err error)
Recognize returns all faces found on the provided image, sorted from left to right. Empty list is returned if there are no faces, error is returned if there was some error while decoding/processing image. Only JPEG format is currently supported. Thread-safe.
type SerializationError ¶
type SerializationError string
An SerializationError is returned when provided model is corrupted.
func (SerializationError) Error ¶
func (e SerializationError) Error() string
type UnknownError ¶
type UnknownError string
An UnknownError represents some nonclassified error.
func (UnknownError) Error ¶
func (e UnknownError) Error() string