Added Class Library FaceRecognitionDotNet
This commit is contained in:
59
Shared/Models/Stateless/FacePart.cs
Normal file
59
Shared/Models/Stateless/FacePart.cs
Normal file
@ -0,0 +1,59 @@
|
||||
namespace View_by_Distance.Shared.Models.Stateless;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the part of face.
|
||||
/// </summary>
|
||||
public enum FacePart
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the chin.
|
||||
/// </summary>
|
||||
Chin,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the left eyebrow.
|
||||
/// </summary>
|
||||
LeftEyebrow,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the right eyebrow.
|
||||
/// </summary>
|
||||
RightEyebrow,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the nose bridge.
|
||||
/// </summary>
|
||||
NoseBridge,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the nose tip.
|
||||
/// </summary>
|
||||
NoseTip,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the left eye.
|
||||
/// </summary>
|
||||
LeftEye,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the right eye.
|
||||
/// </summary>
|
||||
RightEye,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the top lip.
|
||||
/// </summary>
|
||||
TopLip,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the bottom lip.
|
||||
/// </summary>
|
||||
BottomLip,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the nose.
|
||||
/// </summary>
|
||||
Nose,
|
||||
|
||||
}
|
24
Shared/Models/Stateless/ImageFormat.cs
Normal file
24
Shared/Models/Stateless/ImageFormat.cs
Normal file
@ -0,0 +1,24 @@
|
||||
namespace View_by_Distance.Shared.Models.Stateless;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the file format of the image.
|
||||
/// </summary>
|
||||
public enum ImageFormat
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that the bitmap (BMP) image format.
|
||||
/// </summary>
|
||||
Bmp,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that the Joint Photographic Experts Group (JPEG) image format.
|
||||
/// </summary>
|
||||
Jpeg,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that the W3C Portable Network Graphics (PNG) image format.
|
||||
/// </summary>
|
||||
Png,
|
||||
|
||||
}
|
@ -18,6 +18,9 @@ public interface IPersonBirthday
|
||||
string TestStatic_GetFormatted(Models.PersonBirthday personBirthday) => PersonBirthday.GetFormatted(personBirthday);
|
||||
static string GetFormatted(Models.PersonBirthday personBirthday) => PersonBirthday.GetFormatted(personBirthday);
|
||||
|
||||
DateTime? TestStatic_Get(string personKey) => PersonBirthday.Get(personKey);
|
||||
static DateTime? Get(string personKey) => PersonBirthday.Get(personKey);
|
||||
|
||||
string TestStatic_GetFileName(Models.PersonBirthday personBirthday) => PersonBirthday.GetFileName(personBirthday);
|
||||
static string GetFileName(Models.PersonBirthday personBirthday) => PersonBirthday.GetFileName(personBirthday);
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
using System.Globalization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models.Stateless.Methods;
|
||||
|
||||
internal abstract class PersonBirthday
|
||||
@ -13,5 +15,5 @@ internal abstract class PersonBirthday
|
||||
internal static string GetFileName(Models.PersonBirthday personBirthday) => $"{personBirthday.Value.ToString(GetFormat())}.json";
|
||||
internal static bool DoesBirthDateExits(Properties.IStorage storage, Models.PersonBirthday personBirthday) => File.Exists(GetFileFullName(storage, personBirthday));
|
||||
internal static string GetFileFullName(Properties.IStorage storage, Models.PersonBirthday personBirthday) => Path.Combine(storage.PeopleRootDirectory, "{}", GetFileName(personBirthday));
|
||||
|
||||
internal static DateTime? Get(string personKey) => DateTime.TryParseExact(personKey, GetFormat(), CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime dateTime) ? dateTime : null;
|
||||
}
|
19
Shared/Models/Stateless/Mode.cs
Normal file
19
Shared/Models/Stateless/Mode.cs
Normal file
@ -0,0 +1,19 @@
|
||||
namespace View_by_Distance.Shared.Models.Stateless;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the image mode.
|
||||
/// </summary>
|
||||
public enum Mode
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that the rgb (8-bit Red, Green and Blue, 3 channels) image mode.
|
||||
/// </summary>
|
||||
Rgb,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that the greyscale image mode.
|
||||
/// </summary>
|
||||
Greyscale
|
||||
|
||||
}
|
24
Shared/Models/Stateless/Model.cs
Normal file
24
Shared/Models/Stateless/Model.cs
Normal file
@ -0,0 +1,24 @@
|
||||
namespace View_by_Distance.Shared.Models.Stateless;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the model of face detector.
|
||||
/// </summary>
|
||||
public enum Model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that the model is HOG (Histograms of Oriented Gradients) based face detector.
|
||||
/// </summary>
|
||||
Hog,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that the model is CNN (Convolutional Neural Network) based face detector.
|
||||
/// </summary>
|
||||
Cnn,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that the custom face detector.
|
||||
/// </summary>
|
||||
Custom
|
||||
|
||||
}
|
24
Shared/Models/Stateless/PredictorModel.cs
Normal file
24
Shared/Models/Stateless/PredictorModel.cs
Normal file
@ -0,0 +1,24 @@
|
||||
namespace View_by_Distance.Shared.Models.Stateless;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the dimension of vector which be returned from detector.
|
||||
/// </summary>
|
||||
public enum PredictorModel
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that the large scale detector. The detector returns 68 points for represent face.
|
||||
/// </summary>
|
||||
Large,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that the small scale detector. The detector returns 5 points for represent face.
|
||||
/// </summary>
|
||||
Small,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that the custom detector.
|
||||
/// </summary>
|
||||
Custom
|
||||
|
||||
}
|
Reference in New Issue
Block a user