Documentation
¶
Index ¶
Constants ¶
const DescriptorSize = 128
DescriptorSize is a face descriptor size.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Detector ¶
type Detector struct {
// contains filtered or unexported fields
}
Detector is a face detector. It utilizes dlib's CNN face detector. Can detect faces on single image or on multiple images (batch detect).
func NewDetector ¶
NewDetector creates new detector using given model file path. Model file path should be path to mmod_human_face_detector.dat file from https://github.com/davisking/dlib-models.
func (*Detector) BatchDetect ¶
BatchDetect takes images imgs and tries to detect faces on them. Image sizes should be the same. Each array of detections from returned array corresponds to input image with the same index.
type Recognizer ¶
type Recognizer struct {
// contains filtered or unexported fields
}
Recognizer is face recognizer. Doesn't recognize faces actually but computes face descriptors which can be compared later. Utilizes dlib's face recognition model and face shape predictor.
func NewRecognizer ¶
func NewRecognizer(shaperModelFilePath, recognizerModelFilePath string) (*Recognizer, error)
NewRecognizer creates new recognizer using given models. shaperModelFilePath should be a path to shape_predictor_68_face_landmarks.dat file and recognizerModelFilePath should be a path to dlib_face_recognition_resnet_model_v1.dat file. All this files are available in https://github.com/davisking/dlib-models.
func (*Recognizer) Recognize ¶
func (r *Recognizer) Recognize(img gocv.Mat, faceLocation image.Rectangle, padding float64, jittering int) (d Descriptor, err error)
Recognize performs face vectorization process on given image img, face location faceLocation and with given params padding and jittering.