Versions in this module Expand all Collapse all v0 v0.2.0 Aug 4, 2026 Changes in this version + var ErrInvalidRuntimeFS = errors.New("insightface: runtime fs is nil") type Engine + func NewFromFS(ctx context.Context, config Config, source runtimefs.FS) (*Engine, error) v0.1.0 Aug 4, 2026 Changes in this version + var ErrDuplicateIdentity = errors.New("insightface: duplicate identity") + var ErrEmbeddingDimensionMismatch = errors.New("insightface: embedding dimension mismatch") + var ErrEmptyEmbedding = errors.New("insightface: embedding is empty") + var ErrEmptyGallery = errors.New("insightface: gallery is empty") + var ErrEmptyIdentity = errors.New("insightface: identity is empty") + var ErrEngineClosed = errors.New("insightface: engine is closed") + var ErrIdentityHasNoSample = errors.New("insightface: identity has no samples") + var ErrInference = errors.New("insightface: model inference failed") + var ErrInitialization = errors.New("insightface: engine initialization failed") + var ErrInvalidConfig = errors.New("insightface: invalid engine config") + var ErrInvalidContext = errors.New("insightface: context is nil") + var ErrInvalidEmbeddingValue = errors.New("insightface: embedding contains non-finite value") + var ErrInvalidImage = errors.New("insightface: invalid image") + var ErrInvalidLandmarks = errors.New("insightface: invalid landmarks") + var ErrInvalidMatcherConfig = errors.New("insightface: invalid matcher config") + var ErrNilMatcher = errors.New("insightface: matcher is nil") + var ErrZeroNormEmbedding = errors.New("insightface: embedding has zero L2 norm") + type Box struct + Bottom float32 + Left float32 + Right float32 + Top float32 + type Config struct + DetectionThreshold float32 + DetectorInputHeight int + DetectorInputWidth int + DetectorModel string + IntraOpThreads int + NMSThreshold float32 + RecognizerModel string + RuntimeLibrary string + type Detection struct + Box Box + Landmarks Landmarks + Score float32 + type Embedding struct + func NewEmbedding(raw []float32) (Embedding, error) + func (e Embedding) CosineSimilarity(other Embedding) (float32, error) + func (e Embedding) Dimension() int + func (e Embedding) Values() []float32 + type Engine struct + func New(config Config) (*Engine, error) + func (e *Engine) Analyze(ctx context.Context, src image.Image) ([]Face, error) + func (e *Engine) Close() error + func (e *Engine) Detect(ctx context.Context, src image.Image) ([]Detection, error) + func (e *Engine) Embed(ctx context.Context, src image.Image, landmarks Landmarks) (Embedding, error) + type Face struct + Detection Detection + Embedding Embedding + type GalleryIdentity struct + ID string + Samples []Embedding + type Landmarks [5]Point + type MatchCandidate struct + Found bool + Identity string + SampleIndex int + Similarity float32 + type MatchResult struct + Accepted bool + Best MatchCandidate + Margin float32 + SecondBestDifferent MatchCandidate + type Matcher struct + func NewMatcher(config MatcherConfig, gallery []GalleryIdentity) (*Matcher, error) + func (m *Matcher) Match(query Embedding) (MatchResult, error) + func (m *Matcher) MatchVector(raw []float32) (MatchResult, error) + func (m *Matcher) ReplaceGallery(gallery []GalleryIdentity) error + type MatcherConfig struct + MinMargin float32 + MinSimilarity float32 + type Point struct + X float32 + Y float32