using DlibDotNet; using View_by_Distance.FaceRecognitionDotNet.Models; using View_by_Distance.Shared.Models; using View_by_Distance.Shared.Models.Stateless; namespace View_by_Distance.FaceRecognitionDotNet.Extensions; /// /// An abstract base class that provides functionality to detect face parts locations from face image. /// public abstract class FaceLandmarkDetector : DisposableObject { #region Methods internal FullObjectDetection Detect(Image image, Location location) => RawDetect(image.Matrix, location); internal IEnumerable>> GetLandmarks(IEnumerable landmarkTuples) => RawGetLandmarks(landmarkTuples); /// /// Returns an object contains information of face parts corresponds to specified location in specified image. /// /// The matrix contains a face. /// The location rectangle for a face. /// An object contains information of face parts. protected abstract FullObjectDetection RawDetect(MatrixBase matrix, Location location); /// /// Returns an enumerable collection of dictionary of face parts locations (eyes, nose, etc). /// /// The enumerable collection of face parts location. /// An enumerable collection of dictionary of face parts locations (eyes, nose, etc). protected abstract IEnumerable>> RawGetLandmarks(IEnumerable landmarkTuples); #endregion }