.NET API Reference
Namespace
Realeyes.FaceVerification
Classes
FaceVerifier
Main entry point for face detection, embedding, and verification operations. Implements IDisposable.
Constructor
public FaceVerifier(string modelPath, int maxConcurrency = 0)
Creates a new FaceVerifier instance.
Throws:
ArgumentNullException— whenmodelPathis null — when model loading failsFaceVerificationException
Properties
Methods
DetectFacesAsync
public Task<FaceList> DetectFacesAsync(ImageHeader imageHeader)
Detects faces in an image asynchronously.
Returns: Task<FaceList> — disposable collection of detected faces.
Throws: FaceVerificationException
EmbedFaceAsync
public Task<float[]> EmbedFaceAsync(Face face)
Computes the embedding vector for a detected face asynchronously.
Returns: Task<float[]> — embedding vector.
Throws:
ArgumentNullException— whenfaceis null — when embedding failsFaceVerificationException
CompareFaces
public Match CompareFaces(float[] embedding1, float[] embedding2)
Compares two face embeddings and returns a similarity score.
Returns: Match
Throws:
ArgumentNullException— when either embedding is nullArgumentException— when embeddings have different lengths
Dispose
public void Dispose()
Disposes the FaceVerifier and releases native resources.
FaceList
A disposable collection of FaceList<Face> and implements IDisposable and IAsyncDisposable.
Methods
Dispose
public void Dispose()
Disposes all Face objects in the collection synchronously.
DisposeAsync
public ValueTask DisposeAsync()
Disposes all Face objects in the collection asynchronously.
Face
Represents a detected face with landmarks, bounding box, and quality information. Implements IDisposable.
Constructor
public Face(ImageHeader imageHeader, Point2d[] landmarks, BoundingBox boundingBox, float confidence)
Creates a Face object from a third-party face detector.
Throws:
ArgumentNullException— whenimageHeaderorlandmarksis nullArgumentException— when landmarks count is not exactly 5 — when face creation failsFaceVerificationException
Properties
Methods
GetLandmarks
public Point2d[] GetLandmarks()
Gets the facial landmarks.
Returns: Point2d[] — array of 5 landmark points.
Clone
public Face Clone()
Creates a copy of this face.
Returns: Face
Dispose
public void Dispose()
Disposes the face and releases native resources.
Data Types
ImageHeader
Image descriptor for passing image data to the Face Verification Library. (readonly record struct)
Constructor
public ImageHeader(byte[] Data, int Width, int Height, int Stride, ImageFormat Format)
Throws:
ArgumentNullException— whenDatais nullArgumentOutOfRangeException— whenWidth,Height, orStrideis not positive
Properties
BoundingBox
Bounding box representing a rectangular region. (readonly record struct)
Constructor
public BoundingBox(int X, int Y, int Width, int Height)
Properties
Point2d
2D point representing a landmark coordinate. (readonly record struct)
Constructor
public Point2d(float X, float Y)
Properties
Match
Result of face comparison indicating similarity. (readonly record struct)
Constructor
public Match(float Similarity)
Properties
Methods
ExceedsThreshold
public bool ExceedsThreshold(float threshold)
Checks if the similarity score exceeds a threshold.
Returns: bool — true if Similarity >= threshold.
Version
Semantic version number. (readonly record struct)
Constructor
public Version(int Major, int Minor, int Patch)
Properties
Methods
ToString
public override string ToString()
Returns: string — version in "Major.Minor.Patch" format.
Enumerations
ImageFormat
Image pixel format.
DetectionQuality
Detection quality indicator.
Exceptions
FaceVerificationException
Exception thrown when Face Verification Library operations fail. Inherits from Exception.
Constructors
public FaceVerificationException()
public FaceVerificationException(string message)
public FaceVerificationException(string message, Exception innerException)