Versions in this module Expand all Collapse all v1 v1.1.0 Oct 15, 2021 Changes in this version type ErrCode + const NothingMatchErr + const UnknownClassifierErr type Net + func (t *Net) LoadModel() error v1.0.4 Oct 8, 2021 v1.0.3 Oct 7, 2021 v1.0.2 Oct 7, 2021 v1.0.1 Oct 7, 2021 Changes in this version type Faces + func NewFaces(cap int) Faces v1.0.0 Oct 7, 2021 Changes in this version + var ClusterCore = 4 + var ClusterDist = 0.64 + var ClusterMinScore = 15 + var ClusterMinSize = 95 + var CropSize = imageutil.Sizes[imageutil.Tile160] + var File_core_person_proto protoreflect.FileDescriptor + var MatchDist = 0.46 + var MaxImageSize = 640 + var OverlapThreshold = 42 + var OverlapThresholdFloor = OverlapThreshold - 1 + var SampleThreshold = 2 * ClusterCore + var ScoreThreshold = 4.0 + func EuclideanDistance(face1 []float32, face2 []float32) float64 + func LoadPeople(r io.Reader, people *People) error + func QualityThreshold(scale int) (score float32) + func ReadCascadeDir(plc *pigo.PuplocCascade, path string) (result map[string][]*FlpCascade, err error) + type Area struct + Col int + Name string + Row int + Scale int + func NewArea(name string, row, col, scale int) Area + func (a Area) Relative(r Area, rows, cols float32) imageutil.Area + func (a Area) String() string + func (a Area) TopLeft() (int, int) + type Areas []Area + func (pts Areas) Relative(r Area, rows, cols float32) (result imageutil.Areas) + type ErrCode int + const CollisionMatchErr + const ExtractImageSizeTooSmallErr + const ImageToTensorSizeErr + const InferenceFailedErr + const NegativeDistanceMatchErr + const NoFaceErr + const TooFarMatchErr + const UnknownErr + type Error struct + Code ErrCode + Msg string + func NewError(code ErrCode, msg string) Error + func (e Error) Error() string + type Extractor struct + func (d *Extractor) Extract(img image.Image) (faces []pigo.Detection, params pigo.CascadeParams, err error) + func (d *Extractor) Faces(det []pigo.Detection, params pigo.CascadeParams, findLandmarks bool) (results Faces, err error) + type Face struct + Area Area + Cols int + Embeddings [][]float32 + Eyes Areas + Landmarks Areas + Rows int + Score int + func TrySizeExtractSingle(img image.Image, findLandmarks bool, minSize int) (face Face, err error) + func (f *Face) CropArea() imageutil.Area + func (f *Face) Dim() float32 + func (f *Face) EmbeddingsJSON() (b []byte) + func (f *Face) EyesMidpoint() Area + func (f *Face) RelativeLandmarks() imageutil.Areas + func (f *Face) RelativeLandmarksJSON() (b []byte) + func (f *Face) Size() int + type FaceMarker struct + func NewFaceMarker(face Face, label string, distance float64) *FaceMarker + func (f *FaceMarker) SetError(err error) + func (f FaceMarker) Bounds(img image.Image) image.Rectangle + func (f FaceMarker) Distance() float64 + func (f FaceMarker) Error() error + func (f FaceMarker) Face() Face + func (f FaceMarker) Label() string + func (f FaceMarker) Thumb(img image.Image) image.Image + type FaceMarkers struct + func NewFaceMarkers(img image.Image) *FaceMarkers + func (fm *FaceMarkers) Append(m FaceMarker) + func (fm *FaceMarkers) FaceImages(img image.Image) []image.Image + func (fm *FaceMarkers) Markers() []FaceMarker + func (fm FaceMarkers) Draw(font *imageutil.Font, txtColor string, successColor string, failedColor string, ...) image.Image + type Faces []Face + func Extract(img image.Image, findLandmarks bool, minSize int) (faces Faces, err error) + func TrySizeExtractMultiple(img image.Image, findLandmarks bool, minSize int) (faces Faces, err error) + func (faces *Faces) Append(f Face) + func (faces Faces) Contains(other Face) bool + func (faces Faces) Count() int + func (faces Faces) Uncertainty() int + type FlpCascade struct + type Net struct + func NewNet(modelPath string) *Net + func (t *Net) Detect(img image.Image, minSize int, expected int) (faces Faces, err error) + func (t *Net) DetectMultiple(img image.Image, minSize int) (faces Faces, err error) + func (t *Net) DetectSingle(img image.Image, minSize int) (face Face, err error) + func (t *Net) ModelLoaded() bool + func (t *Net) Train(label string, images []image.Image, minSize int) (person Person, err error) + type People struct + List []*Person + func (*People) Descriptor() ([]byte, []int) + func (*People) ProtoMessage() + func (people *People) Append(items ...*Person) + func (people *People) Delete(name string) bool + func (people *People) Match(embedding []float32) (*Person, float64, error) + func (people *People) Nearest(embedding []float32) (*Person, float64) + func (people *People) Neighbour(embedding []float32, nearest *Person) (*Person, float64) + func (people *People) ResolveCollisions() + func (people *People) Save(w io.Writer) error + func (people *People) Setup() + func (x *People) GetList() []*Person + func (x *People) ProtoReflect() protoreflect.Message + func (x *People) Reset() + func (x *People) String() string + type Person struct + Center []float32 + CollisionRadius float64 + Embeddings []*Person_Embedding + Name string + Radius float64 + func (*Person) Descriptor() ([]byte, []int) + func (*Person) ProtoMessage() + func (person *Person) Append(embedding []float32) + func (person *Person) AverageDistance(embedding []float32) float64 + func (person *Person) CalcCenter() (result []float32, radius float64, count int) + func (person *Person) Equal(another *Person) bool + func (person *Person) Match(embedding []float32) (bool, float64) + func (person *Person) ReCenter() + func (person *Person) ResolveCollision(p2 *Person) + func (x *Person) GetCenter() []float32 + func (x *Person) GetCollisionRadius() float64 + func (x *Person) GetEmbeddings() []*Person_Embedding + func (x *Person) GetName() string + func (x *Person) GetRadius() float64 + func (x *Person) ProtoReflect() protoreflect.Message + func (x *Person) Reset() + func (x *Person) String() string + type Person_Embedding struct + Value []float32 + func (*Person_Embedding) Descriptor() ([]byte, []int) + func (*Person_Embedding) ProtoMessage() + func (x *Person_Embedding) GetValue() []float32 + func (x *Person_Embedding) ProtoReflect() protoreflect.Message + func (x *Person_Embedding) Reset() + func (x *Person_Embedding) String() string