After testing E_Distance.SaveGroupedFaceEncodings
This commit is contained in:
35
TestsWithFaceRecognitionDotNet/Models/AppSettings.cs
Normal file
35
TestsWithFaceRecognitionDotNet/Models/AppSettings.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.TestsWithFaceRecognitionDotNet.Models;
|
||||
|
||||
public class AppSettings
|
||||
{
|
||||
|
||||
protected string _Company;
|
||||
protected string _WorkingDirectoryName;
|
||||
protected int? _MaxDegreeOfParallelism;
|
||||
public string Company => _Company;
|
||||
public string WorkingDirectoryName => _WorkingDirectoryName;
|
||||
public int? MaxDegreeOfParallelism => _MaxDegreeOfParallelism;
|
||||
|
||||
// public AppSettings()
|
||||
// {
|
||||
|
||||
// }
|
||||
|
||||
[JsonConstructor]
|
||||
public AppSettings(string company, string workingDirectoryName, int? maxDegreeOfParallelism)
|
||||
{
|
||||
_Company = company;
|
||||
_WorkingDirectoryName = workingDirectoryName;
|
||||
_MaxDegreeOfParallelism = maxDegreeOfParallelism;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
26
TestsWithFaceRecognitionDotNet/Models/Binder/AppSettings.cs
Normal file
26
TestsWithFaceRecognitionDotNet/Models/Binder/AppSettings.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace View_by_Distance.TestsWithFaceRecognitionDotNet.Models.Binder;
|
||||
|
||||
public class AppSettings
|
||||
{
|
||||
|
||||
[Display(Name = "Company"), Required] public string Company { get; set; }
|
||||
[Display(Name = "Working Directory Name"), Required] public string WorkingDirectoryName { get; set; }
|
||||
[Display(Name = "Max Degree Of Parallelism"), Required] public int? MaxDegreeOfParallelism { get; set; }
|
||||
|
||||
public AppSettings()
|
||||
{
|
||||
Company = string.Empty;
|
||||
WorkingDirectoryName = string.Empty;
|
||||
MaxDegreeOfParallelism = -1;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
103
TestsWithFaceRecognitionDotNet/Models/Binder/Configuration.cs
Normal file
103
TestsWithFaceRecognitionDotNet/Models/Binder/Configuration.cs
Normal file
@ -0,0 +1,103 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace View_by_Distance.TestsWithFaceRecognitionDotNet.Models.Binder;
|
||||
|
||||
public class Configuration
|
||||
{
|
||||
|
||||
[Display(Name = "Check Json For Distance Results"), Required] public bool? CheckJsonForDistanceResults { get; set; }
|
||||
[Display(Name = "CrossDirectory Max Items In Distance Collection"), Required] public int? CrossDirectoryMaxItemsInDistanceCollection { get; set; }
|
||||
[Display(Name = "Distance Factor"), Required] public int? DistanceFactor { get; set; }
|
||||
[Display(Name = "Force Metadata Last Write Time to Creation Time"), Required] public bool? ForceMetadataLastWriteTimeToCreationTime { get; set; }
|
||||
[Display(Name = "Force Resize Last Write Time to Creation Time"), Required] public bool? ForceResizeLastWriteTimeToCreationTime { get; set; }
|
||||
[Display(Name = "Ignore Extensions"), Required] public string[] IgnoreExtensions { get; set; }
|
||||
[Display(Name = "Ignore Relative Paths"), Required] public string[] IgnoreRelativePaths { get; set; }
|
||||
[Display(Name = "Julie Phares Copy Birthdays"), Required] public string[] JuliePhares { get; set; }
|
||||
[Display(Name = "Load Or Create Then Save Directory Distance Results"), Required] public string[] LoadOrCreateThenSaveDirectoryDistanceResultsForOutputResolutions { get; set; }
|
||||
[Display(Name = "Load Or Create Then Save Distance Results"), Required] public string[] LoadOrCreateThenSaveDistanceResultsForOutputResolutions { get; set; }
|
||||
[Display(Name = "Load Or Create Then Save Image Faces Results"), Required] public string[] LoadOrCreateThenSaveImageFacesResultsForOutputResolutions { get; set; }
|
||||
[Display(Name = "Load Or Create Then Save Index"), Required] public bool? LoadOrCreateThenSaveIndex { get; set; }
|
||||
[Display(Name = "Location Confidence Factor"), Required] public int? LocationConfidenceFactor { get; set; }
|
||||
[Display(Name = "Mapped Max Index"), Required] public int? MappedMaxIndex { get; set; }
|
||||
[Display(Name = "Max Items In Distance Collection"), Required] public int? MaxItemsInDistanceCollection { get; set; }
|
||||
[Display(Name = "Mixed Year Relative Paths"), Required] public string[] MixedYearRelativePaths { get; set; }
|
||||
[Display(Name = "Model Directory"), Required] public string ModelDirectory { get; set; }
|
||||
[Display(Name = "Model Name"), Required] public string ModelName { get; set; }
|
||||
[Display(Name = "Number Jitters"), Required] public int? NumberOfJitters { get; set; }
|
||||
[Display(Name = "Number of Times To Up Sample"), Required] public int? NumberOfTimesToUpsample { get; set; }
|
||||
[Display(Name = "Output Extension"), Required] public string OutputExtension { get; set; }
|
||||
[Display(Name = "Output Quality"), Required] public int? OutputQuality { get; set; }
|
||||
[Display(Name = "Output Resolutions"), Required] public string[] OutputResolutions { get; set; }
|
||||
[Display(Name = "Override For Face Images"), Required] public bool? OverrideForFaceImages { get; set; }
|
||||
[Display(Name = "Override For Face Landmark Images"), Required] public bool? OverrideForFaceLandmarkImages { get; set; }
|
||||
[Display(Name = "Override For Resize Images"), Required] public bool? OverrideForResizeImages { get; set; }
|
||||
[Display(Name = "Padding Loops"), Required] public int? PaddingLoops { get; set; }
|
||||
[Display(Name = "Predictor Model Name"), Required] public string PredictorModelName { get; set; }
|
||||
[Display(Name = "Properties Changed For Distance"), Required] public bool? PropertiesChangedForDistance { get; set; }
|
||||
[Display(Name = "Properties Changed For Faces"), Required] public bool? PropertiesChangedForFaces { get; set; }
|
||||
[Display(Name = "Properties Changed For Index"), Required] public bool? PropertiesChangedForIndex { get; set; }
|
||||
[Display(Name = "Properties Changed For Metadata"), Required] public bool? PropertiesChangedForMetadata { get; set; }
|
||||
[Display(Name = "Properties Changed For Resize"), Required] public bool? PropertiesChangedForResize { get; set; }
|
||||
[Display(Name = "Property Configuration"), Required] public Property.Models.Configuration? PropertyConfiguration { get; set; }
|
||||
[Display(Name = "Reverse"), Required] public bool? Reverse { get; set; }
|
||||
[Display(Name = "Save Face Landmark For Output Resolutions"), Required] public string[] SaveFaceLandmarkForOutputResolutions { get; set; }
|
||||
[Display(Name = "Save Full Year Of Random Files"), Required] public bool? SaveFullYearOfRandomFiles { get; set; }
|
||||
[Display(Name = "Save Resized Subfiles"), Required] public bool? SaveResizedSubfiles { get; set; }
|
||||
[Display(Name = "Save Shortcuts"), Required] public string[] SaveShortcutsForOutputResolutions { get; set; }
|
||||
[Display(Name = "Skip Search"), Required] public bool? SkipSearch { get; set; }
|
||||
[Display(Name = "Test Distance Results"), Required] public bool? TestDistanceResults { get; set; }
|
||||
[Display(Name = "Valid Resolutions"), Required] public string[] ValidResolutions { get; set; }
|
||||
|
||||
public Configuration()
|
||||
{
|
||||
CheckJsonForDistanceResults = null;
|
||||
CrossDirectoryMaxItemsInDistanceCollection = null;
|
||||
DistanceFactor = null;
|
||||
ForceMetadataLastWriteTimeToCreationTime = null;
|
||||
ForceResizeLastWriteTimeToCreationTime = null;
|
||||
IgnoreExtensions = Array.Empty<string>();
|
||||
IgnoreRelativePaths = Array.Empty<string>();
|
||||
JuliePhares = Array.Empty<string>();
|
||||
LoadOrCreateThenSaveDirectoryDistanceResultsForOutputResolutions = Array.Empty<string>();
|
||||
LoadOrCreateThenSaveDistanceResultsForOutputResolutions = Array.Empty<string>();
|
||||
LoadOrCreateThenSaveImageFacesResultsForOutputResolutions = Array.Empty<string>();
|
||||
LoadOrCreateThenSaveIndex = null;
|
||||
LocationConfidenceFactor = null;
|
||||
MappedMaxIndex = null;
|
||||
MaxItemsInDistanceCollection = null;
|
||||
MixedYearRelativePaths = Array.Empty<string>();
|
||||
ModelDirectory = string.Empty;
|
||||
ModelName = string.Empty;
|
||||
NumberOfJitters = null;
|
||||
NumberOfTimesToUpsample = null;
|
||||
OutputExtension = string.Empty;
|
||||
OutputQuality = null;
|
||||
OutputResolutions = Array.Empty<string>();
|
||||
OverrideForFaceImages = null;
|
||||
OverrideForFaceLandmarkImages = null;
|
||||
OverrideForResizeImages = null;
|
||||
PaddingLoops = null;
|
||||
PredictorModelName = string.Empty;
|
||||
PropertiesChangedForDistance = null;
|
||||
PropertiesChangedForFaces = null;
|
||||
PropertiesChangedForIndex = null;
|
||||
PropertiesChangedForMetadata = null;
|
||||
PropertiesChangedForResize = null;
|
||||
Reverse = null;
|
||||
SaveFaceLandmarkForOutputResolutions = Array.Empty<string>();
|
||||
SaveFullYearOfRandomFiles = null;
|
||||
SaveResizedSubfiles = null;
|
||||
SaveShortcutsForOutputResolutions = Array.Empty<string>();
|
||||
SkipSearch = null;
|
||||
TestDistanceResults = null;
|
||||
ValidResolutions = Array.Empty<string>();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
151
TestsWithFaceRecognitionDotNet/Models/Configuration.cs
Normal file
151
TestsWithFaceRecognitionDotNet/Models/Configuration.cs
Normal file
@ -0,0 +1,151 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.TestsWithFaceRecognitionDotNet.Models;
|
||||
|
||||
public class Configuration
|
||||
{
|
||||
|
||||
protected readonly bool? _CheckJsonForDistanceResults;
|
||||
protected readonly int? _CrossDirectoryMaxItemsInDistanceCollection;
|
||||
protected readonly int? _DistanceFactor;
|
||||
protected readonly bool? _ForceMetadataLastWriteTimeToCreationTime;
|
||||
protected readonly bool? _ForceResizeLastWriteTimeToCreationTime;
|
||||
protected readonly string[] _IgnoreExtensions;
|
||||
protected readonly string[] _IgnoreRelativePaths;
|
||||
protected readonly string[] _JuliePhares;
|
||||
protected readonly string[] _LoadOrCreateThenSaveDirectoryDistanceResultsForOutputResolutions;
|
||||
protected readonly string[] _LoadOrCreateThenSaveDistanceResultsForOutputResolutions;
|
||||
protected readonly string[] _LoadOrCreateThenSaveImageFacesResultsForOutputResolutions;
|
||||
protected readonly bool? _LoadOrCreateThenSaveIndex;
|
||||
protected readonly int? _LocationConfidenceFactor;
|
||||
protected readonly int? _MappedMaxIndex;
|
||||
protected readonly int? _MaxItemsInDistanceCollection;
|
||||
protected readonly string[] _MixedYearRelativePaths;
|
||||
protected readonly string _ModelDirectory;
|
||||
protected readonly string _ModelName;
|
||||
protected readonly int? _NumberOfJitters;
|
||||
protected readonly int? _NumberOfTimesToUpsample;
|
||||
protected readonly string _OutputExtension;
|
||||
protected readonly int? _OutputQuality;
|
||||
protected readonly string[] _OutputResolutions;
|
||||
protected readonly bool? _OverrideForFaceImages;
|
||||
protected readonly bool? _OverrideForFaceLandmarkImages;
|
||||
protected readonly bool? _OverrideForResizeImages;
|
||||
protected readonly int? _PaddingLoops;
|
||||
protected readonly string _PredictorModelName;
|
||||
protected readonly bool? _PropertiesChangedForDistance;
|
||||
protected readonly bool? _PropertiesChangedForFaces;
|
||||
protected readonly bool? _PropertiesChangedForIndex;
|
||||
protected readonly bool? _PropertiesChangedForMetadata;
|
||||
protected readonly bool? _PropertiesChangedForResize;
|
||||
protected Property.Models.Configuration? _PropertyConfiguration;
|
||||
protected readonly bool? _Reverse;
|
||||
protected readonly string[] _SaveFaceLandmarkForOutputResolutions;
|
||||
protected readonly bool? _SaveFullYearOfRandomFiles;
|
||||
protected readonly bool? _SaveResizedSubfiles;
|
||||
protected readonly string[] _SaveShortcutsForOutputResolutions;
|
||||
protected readonly bool? _SkipSearch;
|
||||
protected readonly bool? _TestDistanceResults;
|
||||
protected readonly string[] _ValidResolutions;
|
||||
public bool? CheckJsonForDistanceResults => _CheckJsonForDistanceResults;
|
||||
public int? CrossDirectoryMaxItemsInDistanceCollection => _CrossDirectoryMaxItemsInDistanceCollection;
|
||||
public int? DistanceFactor => _DistanceFactor;
|
||||
public bool? ForceMetadataLastWriteTimeToCreationTime => _ForceMetadataLastWriteTimeToCreationTime;
|
||||
public bool? ForceResizeLastWriteTimeToCreationTime => _ForceResizeLastWriteTimeToCreationTime;
|
||||
public string[] IgnoreExtensions => _IgnoreExtensions;
|
||||
public string[] IgnoreRelativePaths => _IgnoreRelativePaths;
|
||||
public string[] JuliePhares => _JuliePhares;
|
||||
public string[] LoadOrCreateThenSaveDirectoryDistanceResultsForOutputResolutions => _LoadOrCreateThenSaveDirectoryDistanceResultsForOutputResolutions;
|
||||
public string[] LoadOrCreateThenSaveDistanceResultsForOutputResolutions => _LoadOrCreateThenSaveDistanceResultsForOutputResolutions;
|
||||
public string[] LoadOrCreateThenSaveImageFacesResultsForOutputResolutions => _LoadOrCreateThenSaveImageFacesResultsForOutputResolutions;
|
||||
public bool? LoadOrCreateThenSaveIndex => _LoadOrCreateThenSaveIndex;
|
||||
public int? LocationConfidenceFactor => _LocationConfidenceFactor;
|
||||
public int? MappedMaxIndex => _MappedMaxIndex;
|
||||
public int? MaxItemsInDistanceCollection => _MaxItemsInDistanceCollection;
|
||||
public string[] MixedYearRelativePaths => _MixedYearRelativePaths;
|
||||
public string ModelDirectory => _ModelDirectory;
|
||||
public string ModelName => _ModelName;
|
||||
public int? NumberOfJitters => _NumberOfJitters;
|
||||
public int? NumberOfTimesToUpsample => _NumberOfTimesToUpsample;
|
||||
public string OutputExtension => _OutputExtension;
|
||||
public int? OutputQuality => _OutputQuality;
|
||||
public string[] OutputResolutions => _OutputResolutions;
|
||||
public bool? OverrideForFaceImages => _OverrideForFaceImages;
|
||||
public bool? OverrideForFaceLandmarkImages => _OverrideForFaceLandmarkImages;
|
||||
public bool? OverrideForResizeImages => _OverrideForResizeImages;
|
||||
public int? PaddingLoops => _PaddingLoops;
|
||||
public string PredictorModelName => _PredictorModelName;
|
||||
public bool? PropertiesChangedForDistance => _PropertiesChangedForDistance;
|
||||
public bool? PropertiesChangedForFaces => _PropertiesChangedForFaces;
|
||||
public bool? PropertiesChangedForIndex => _PropertiesChangedForIndex;
|
||||
public bool? PropertiesChangedForMetadata => _PropertiesChangedForMetadata;
|
||||
public bool? PropertiesChangedForResize => _PropertiesChangedForResize;
|
||||
public Property.Models.Configuration? PropertyConfiguration => _PropertyConfiguration;
|
||||
public bool? Reverse => _Reverse;
|
||||
public string[] SaveFaceLandmarkForOutputResolutions => _SaveFaceLandmarkForOutputResolutions;
|
||||
public bool? SaveFullYearOfRandomFiles => _SaveFullYearOfRandomFiles;
|
||||
public bool? SaveResizedSubfiles => _SaveResizedSubfiles;
|
||||
public string[] SaveShortcutsForOutputResolutions => _SaveShortcutsForOutputResolutions;
|
||||
public bool? SkipSearch => _SkipSearch;
|
||||
public bool? TestDistanceResults => _TestDistanceResults;
|
||||
public string[] ValidResolutions => _ValidResolutions;
|
||||
|
||||
[JsonConstructor]
|
||||
public Configuration(bool? checkJsonForDistanceResults, int? crossDirectoryMaxItemsInDistanceCollection, int? distanceFactor, bool? forceMetadataLastWriteTimeToCreationTime, bool? forceResizeLastWriteTimeToCreationTime, string[] ignoreExtensions, string[] ignoreRelativePaths, string[] juliePhares, string[] loadOrCreateThenSaveDirectoryDistanceResultsForOutputResolutions, string[] loadOrCreateThenSaveDistanceResultsForOutputResolutions, string[] loadOrCreateThenSaveImageFacesResultsForOutputResolutions, bool? loadOrCreateThenSaveIndex, int? locationConfidenceFactor, int? mappedMaxIndex, int? maxItemsInDistanceCollection, string[] mixedYearRelativePaths, string modelDirectory, string modelName, int? numberOfJitters, int? numberOfTimesToUpsample, string outputExtension, int? outputQuality, string[] outputResolutions, bool? overrideForFaceImages, bool? overrideForFaceLandmarkImages, bool? overrideForResizeImages, int? paddingLoops, string predictorModelName, bool? propertiesChangedForDistance, bool? propertiesChangedForFaces, bool? propertiesChangedForIndex, bool? propertiesChangedForMetadata, bool? propertiesChangedForResize, Property.Models.Configuration? propertyConfiguration, bool? reverse, string[] saveFaceLandmarkForOutputResolutions, bool? saveFullYearOfRandomFiles, bool? saveResizedSubfiles, string[] saveShortcutsForOutputResolutions, bool? skipSearch, bool? testDistanceResults, string[] validResolutions)
|
||||
{
|
||||
_CheckJsonForDistanceResults = checkJsonForDistanceResults;
|
||||
_CrossDirectoryMaxItemsInDistanceCollection = crossDirectoryMaxItemsInDistanceCollection;
|
||||
_DistanceFactor = distanceFactor;
|
||||
_ForceMetadataLastWriteTimeToCreationTime = forceMetadataLastWriteTimeToCreationTime;
|
||||
_ForceResizeLastWriteTimeToCreationTime = forceResizeLastWriteTimeToCreationTime;
|
||||
_IgnoreExtensions = ignoreExtensions;
|
||||
_IgnoreRelativePaths = ignoreRelativePaths;
|
||||
_JuliePhares = juliePhares;
|
||||
_LoadOrCreateThenSaveDirectoryDistanceResultsForOutputResolutions = loadOrCreateThenSaveDirectoryDistanceResultsForOutputResolutions;
|
||||
_LoadOrCreateThenSaveDistanceResultsForOutputResolutions = loadOrCreateThenSaveDistanceResultsForOutputResolutions;
|
||||
_LoadOrCreateThenSaveImageFacesResultsForOutputResolutions = loadOrCreateThenSaveImageFacesResultsForOutputResolutions;
|
||||
_LoadOrCreateThenSaveIndex = loadOrCreateThenSaveIndex;
|
||||
_LocationConfidenceFactor = locationConfidenceFactor;
|
||||
_MappedMaxIndex = mappedMaxIndex;
|
||||
_MaxItemsInDistanceCollection = maxItemsInDistanceCollection;
|
||||
_MixedYearRelativePaths = mixedYearRelativePaths;
|
||||
_ModelDirectory = modelDirectory;
|
||||
_ModelName = modelName;
|
||||
_NumberOfJitters = numberOfJitters;
|
||||
_NumberOfTimesToUpsample = numberOfTimesToUpsample;
|
||||
_OutputExtension = outputExtension;
|
||||
_OutputQuality = outputQuality;
|
||||
_OutputResolutions = outputResolutions;
|
||||
_OverrideForFaceImages = overrideForFaceImages;
|
||||
_OverrideForFaceLandmarkImages = overrideForFaceLandmarkImages;
|
||||
_OverrideForResizeImages = overrideForResizeImages;
|
||||
_PaddingLoops = paddingLoops;
|
||||
_PredictorModelName = predictorModelName;
|
||||
_PropertiesChangedForDistance = propertiesChangedForDistance;
|
||||
_PropertiesChangedForFaces = propertiesChangedForFaces;
|
||||
_PropertiesChangedForIndex = propertiesChangedForIndex;
|
||||
_PropertiesChangedForMetadata = propertiesChangedForMetadata;
|
||||
_PropertiesChangedForResize = propertiesChangedForResize;
|
||||
_PropertyConfiguration = propertyConfiguration;
|
||||
_Reverse = reverse;
|
||||
_SaveFaceLandmarkForOutputResolutions = saveFaceLandmarkForOutputResolutions;
|
||||
_SaveFullYearOfRandomFiles = saveFullYearOfRandomFiles;
|
||||
_SaveResizedSubfiles = saveResizedSubfiles;
|
||||
_SaveShortcutsForOutputResolutions = saveShortcutsForOutputResolutions;
|
||||
_SkipSearch = skipSearch;
|
||||
_TestDistanceResults = testDistanceResults;
|
||||
_ValidResolutions = validResolutions;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
||||
return result;
|
||||
}
|
||||
|
||||
public void Set(Property.Models.Configuration configuration) => _PropertyConfiguration = configuration;
|
||||
|
||||
public void Update() => _PropertyConfiguration?.Update();
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace View_by_Distance.TestsWithFaceRecognitionDotNet.Models.Stateless;
|
||||
|
||||
public abstract class AppSettings
|
||||
{
|
||||
|
||||
public static Models.AppSettings Get(IConfigurationRoot configurationRoot)
|
||||
{
|
||||
Models.AppSettings? result;
|
||||
Binder.AppSettings appSettings = configurationRoot.Get<Binder.AppSettings>();
|
||||
string json = JsonSerializer.Serialize(appSettings, new JsonSerializerOptions() { WriteIndented = true });
|
||||
result = JsonSerializer.Deserialize<Models.AppSettings>(json);
|
||||
if (result is null)
|
||||
throw new Exception(json);
|
||||
if (string.IsNullOrEmpty(result.Company))
|
||||
throw new Exception(json);
|
||||
string jsonThis = result.ToString();
|
||||
if (jsonThis != json)
|
||||
{
|
||||
int? check = null;
|
||||
int min = new int[] { json.Length, jsonThis.Length }.Min();
|
||||
for (int i = 0; i < min; i++)
|
||||
{
|
||||
if (json[i] == jsonThis[i])
|
||||
continue;
|
||||
check = i;
|
||||
break;
|
||||
}
|
||||
if (check is null)
|
||||
throw new Exception();
|
||||
string a = json[..check.Value].Split(',')[^1];
|
||||
string b = json[check.Value..].Split(',')[0];
|
||||
throw new Exception($"{a}{b}");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Phares.Shared;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace View_by_Distance.TestsWithFaceRecognitionDotNet.Models.Stateless;
|
||||
|
||||
public abstract class Configuration
|
||||
{
|
||||
|
||||
public static Models.Configuration Get(IsEnvironment isEnvironment, IConfigurationRoot configurationRoot, string workingDirectory, Property.Models.Configuration propertyConfiguration)
|
||||
{
|
||||
Models.Configuration? result;
|
||||
string environmentName = IsEnvironment.GetEnvironmentName(isEnvironment);
|
||||
string section = string.Concat(environmentName, ":", nameof(Binder.Configuration));
|
||||
IConfigurationSection configurationSection = configurationRoot.GetSection(section);
|
||||
Binder.Configuration configuration = configurationSection.Get<Binder.Configuration>();
|
||||
string json = JsonSerializer.Serialize(configuration, new JsonSerializerOptions() { WriteIndented = true });
|
||||
result = JsonSerializer.Deserialize<Models.Configuration>(json);
|
||||
if (result is null)
|
||||
throw new Exception(json);
|
||||
string jsonThis = result.ToString();
|
||||
result.Set(propertyConfiguration);
|
||||
result.Update();
|
||||
if (jsonThis != json)
|
||||
{
|
||||
int? check = null;
|
||||
int min = new int[] { json.Length, jsonThis.Length }.Min();
|
||||
for (int i = 0; i < min; i++)
|
||||
{
|
||||
if (json[i] == jsonThis[i])
|
||||
continue;
|
||||
check = i;
|
||||
break;
|
||||
}
|
||||
if (check is null)
|
||||
throw new Exception();
|
||||
string a = json[..check.Value].Split(',')[^1];
|
||||
string b = json[check.Value..].Split(',')[0];
|
||||
throw new Exception($"{a}{b}");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<IsPackable>false</IsPackable>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
|
||||
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsOSX>
|
||||
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(IsWindows)'=='true'">
|
||||
<DefineConstants>Windows</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(IsOSX)'=='true'">
|
||||
<DefineConstants>OSX</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(IsLinux)'=='true'">
|
||||
<DefineConstants>Linux</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.7" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.3.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
<PackageReference Include="Serilog" Version="2.10.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Shared\View-by-Distance.Shared.csproj" />
|
||||
<ProjectReference Include="..\Property\Property.csproj" />
|
||||
<ProjectReference Include="..\Metadata\Metadata.csproj" />
|
||||
<ProjectReference Include="..\Resize\Resize.csproj" />
|
||||
<ProjectReference Include="..\FaceRecognitionDotNet\FaceRecognitionDotNet.csproj" />
|
||||
<ProjectReference Include="..\Property-Compare\Property-Compare.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="appsettings.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="appsettings.Development.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
71
TestsWithFaceRecognitionDotNet/UnitTestExample.cs
Normal file
71
TestsWithFaceRecognitionDotNet/UnitTestExample.cs
Normal file
@ -0,0 +1,71 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Phares.Shared;
|
||||
using Serilog;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using View_by_Distance.Shared.Models.Stateless.Methods;
|
||||
using View_by_Distance.TestsWithFaceRecognitionDotNet.Models;
|
||||
|
||||
namespace View_by_Distance.TestsWithFaceRecognitionDotNet;
|
||||
|
||||
[TestClass]
|
||||
public class UnitTestExample
|
||||
{
|
||||
|
||||
private readonly ILogger _Logger;
|
||||
private readonly AppSettings _AppSettings;
|
||||
private readonly string _WorkingDirectory;
|
||||
private readonly Configuration _Configuration;
|
||||
private readonly IsEnvironment _IsEnvironment;
|
||||
private readonly IConfigurationRoot _ConfigurationRoot;
|
||||
private readonly Property.Models.Configuration _PropertyConfiguration;
|
||||
|
||||
public UnitTestExample()
|
||||
{
|
||||
ILogger logger;
|
||||
AppSettings appSettings;
|
||||
string workingDirectory;
|
||||
Configuration configuration;
|
||||
IsEnvironment isEnvironment;
|
||||
IConfigurationRoot configurationRoot;
|
||||
LoggerConfiguration loggerConfiguration = new();
|
||||
Property.Models.Configuration propertyConfiguration;
|
||||
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||
bool debuggerWasAttachedAtLineZero = Debugger.IsAttached || assembly.Location.Contains(@"\bin\Debug");
|
||||
isEnvironment = new(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: debuggerWasAttachedAtLineZero, nullASPNetCoreEnvironmentIsProduction: !debuggerWasAttachedAtLineZero);
|
||||
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile(isEnvironment.AppSettingsFileName);
|
||||
configurationRoot = configurationBuilder.Build();
|
||||
appSettings = Models.Stateless.AppSettings.Get(configurationRoot);
|
||||
workingDirectory = IWorkingDirectory.GetWorkingDirectory(assembly.GetName().Name, appSettings.WorkingDirectoryName);
|
||||
Environment.SetEnvironmentVariable(nameof(workingDirectory), workingDirectory);
|
||||
_ = ConfigurationLoggerConfigurationExtensions.Configuration(loggerConfiguration.ReadFrom, configurationRoot);
|
||||
Log.Logger = loggerConfiguration.CreateLogger();
|
||||
logger = Log.ForContext<UnitTestExample>();
|
||||
propertyConfiguration = Property.Models.Stateless.Configuration.Get(isEnvironment, configurationRoot, workingDirectory);
|
||||
configuration = Models.Stateless.Configuration.Get(isEnvironment, configurationRoot, workingDirectory, propertyConfiguration);
|
||||
logger.Information("Complete");
|
||||
_Logger = logger;
|
||||
_AppSettings = appSettings;
|
||||
_Configuration = configuration;
|
||||
_IsEnvironment = isEnvironment;
|
||||
_WorkingDirectory = workingDirectory;
|
||||
_ConfigurationRoot = configurationRoot;
|
||||
_PropertyConfiguration = propertyConfiguration;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestMethodNull()
|
||||
{
|
||||
Assert.IsFalse(_Logger is null);
|
||||
Assert.IsFalse(_AppSettings is null);
|
||||
Assert.IsFalse(_Configuration is null);
|
||||
Assert.IsFalse(_IsEnvironment is null);
|
||||
Assert.IsFalse(_WorkingDirectory is null);
|
||||
Assert.IsFalse(_ConfigurationRoot is null);
|
||||
Assert.IsFalse(_PropertyConfiguration is null);
|
||||
}
|
||||
|
||||
}
|
253
TestsWithFaceRecognitionDotNet/UnitTestFace.cs
Normal file
253
TestsWithFaceRecognitionDotNet/UnitTestFace.cs
Normal file
@ -0,0 +1,253 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Phares.Shared;
|
||||
using Serilog;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Reflection;
|
||||
using View_by_Distance.FaceRecognitionDotNet;
|
||||
using View_by_Distance.Metadata.Models;
|
||||
using View_by_Distance.Resize.Models;
|
||||
using View_by_Distance.Shared.Models;
|
||||
using View_by_Distance.Shared.Models.Stateless;
|
||||
using View_by_Distance.Shared.Models.Stateless.Methods;
|
||||
using View_by_Distance.TestsWithFaceRecognitionDotNet.Models;
|
||||
|
||||
namespace View_by_Distance.TestsWithFaceRecognitionDotNet;
|
||||
|
||||
[TestClass]
|
||||
public class UnitTestFace
|
||||
{
|
||||
|
||||
private readonly ILogger _Logger;
|
||||
private readonly AppSettings _AppSettings;
|
||||
private readonly string _WorkingDirectory;
|
||||
private readonly Configuration _Configuration;
|
||||
private readonly IsEnvironment _IsEnvironment;
|
||||
private readonly IConfigurationRoot _ConfigurationRoot;
|
||||
private readonly Property.Models.Configuration _PropertyConfiguration;
|
||||
|
||||
public UnitTestFace()
|
||||
{
|
||||
ILogger logger;
|
||||
AppSettings appSettings;
|
||||
string workingDirectory;
|
||||
Configuration configuration;
|
||||
IsEnvironment isEnvironment;
|
||||
IConfigurationRoot configurationRoot;
|
||||
LoggerConfiguration loggerConfiguration = new();
|
||||
Property.Models.Configuration propertyConfiguration;
|
||||
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||
bool debuggerWasAttachedAtLineZero = Debugger.IsAttached || assembly.Location.Contains(@"\bin\Debug");
|
||||
isEnvironment = new(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: debuggerWasAttachedAtLineZero, nullASPNetCoreEnvironmentIsProduction: !debuggerWasAttachedAtLineZero);
|
||||
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile(isEnvironment.AppSettingsFileName);
|
||||
configurationRoot = configurationBuilder.Build();
|
||||
appSettings = Models.Stateless.AppSettings.Get(configurationRoot);
|
||||
workingDirectory = IWorkingDirectory.GetWorkingDirectory(assembly.GetName().Name, appSettings.WorkingDirectoryName);
|
||||
Environment.SetEnvironmentVariable(nameof(workingDirectory), workingDirectory);
|
||||
_ = ConfigurationLoggerConfigurationExtensions.Configuration(loggerConfiguration.ReadFrom, configurationRoot);
|
||||
Log.Logger = loggerConfiguration.CreateLogger();
|
||||
logger = Log.ForContext<UnitTestFace>();
|
||||
propertyConfiguration = Property.Models.Stateless.Configuration.Get(isEnvironment, configurationRoot, workingDirectory);
|
||||
configuration = Models.Stateless.Configuration.Get(isEnvironment, configurationRoot, workingDirectory, propertyConfiguration);
|
||||
logger.Information("Complete");
|
||||
_Logger = logger;
|
||||
_AppSettings = appSettings;
|
||||
_Configuration = configuration;
|
||||
_IsEnvironment = isEnvironment;
|
||||
_WorkingDirectory = workingDirectory;
|
||||
_ConfigurationRoot = configurationRoot;
|
||||
_PropertyConfiguration = propertyConfiguration;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestMethodNull()
|
||||
{
|
||||
Assert.IsFalse(_Logger is null);
|
||||
Assert.IsFalse(_AppSettings is null);
|
||||
Assert.IsFalse(_Configuration is null);
|
||||
Assert.IsFalse(_IsEnvironment is null);
|
||||
Assert.IsFalse(_WorkingDirectory is null);
|
||||
Assert.IsFalse(_ConfigurationRoot is null);
|
||||
Assert.IsFalse(_PropertyConfiguration is null);
|
||||
}
|
||||
|
||||
private Property.Models.PropertyLogic GetPropertyLogic()
|
||||
{
|
||||
Property.Models.PropertyLogic result;
|
||||
if (_AppSettings.MaxDegreeOfParallelism is null)
|
||||
throw new ArgumentNullException(nameof(_AppSettings.MaxDegreeOfParallelism));
|
||||
if (_Configuration?.PropertyConfiguration is null)
|
||||
throw new ArgumentNullException(nameof(_Configuration.PropertyConfiguration));
|
||||
result = new(_AppSettings.MaxDegreeOfParallelism.Value, _Configuration.PropertyConfiguration);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static (Model model, PredictorModel predictorModel, ModelParameter modelParameter) GetModel(Configuration configuration)
|
||||
{
|
||||
(Model, PredictorModel, ModelParameter) result;
|
||||
Array array;
|
||||
Model? model = null;
|
||||
PredictorModel? predictorModel = null;
|
||||
array = Enum.GetValues(typeof(Model));
|
||||
foreach (Model check in array)
|
||||
{
|
||||
if (configuration.ModelName.Contains(check.ToString()))
|
||||
{
|
||||
model = check;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (model is null)
|
||||
throw new Exception("Destination directory must have Model name!");
|
||||
model = model.Value;
|
||||
array = Enum.GetValues(typeof(PredictorModel));
|
||||
foreach (PredictorModel check in array)
|
||||
{
|
||||
if (configuration.PredictorModelName.Contains(check.ToString()))
|
||||
{
|
||||
predictorModel = check;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (predictorModel is null)
|
||||
throw new Exception("Destination directory must have Predictor Model name!");
|
||||
predictorModel = predictorModel.Value;
|
||||
ModelParameter modelParameter = new()
|
||||
{
|
||||
CnnFaceDetectorModel = File.ReadAllBytes(Path.Combine(configuration.ModelDirectory, "mmod_human_face_detector.dat")),
|
||||
FaceRecognitionModel = File.ReadAllBytes(Path.Combine(configuration.ModelDirectory, "dlib_face_recognition_resnet_model_v1.dat")),
|
||||
PosePredictor5FaceLandmarksModel = File.ReadAllBytes(Path.Combine(configuration.ModelDirectory, "shape_predictor_5_face_landmarks.dat")),
|
||||
PosePredictor68FaceLandmarksModel = File.ReadAllBytes(Path.Combine(configuration.ModelDirectory, "shape_predictor_68_face_landmarks.dat"))
|
||||
};
|
||||
result = new(model.Value, predictorModel.Value, modelParameter);
|
||||
return result;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGetPixelPercentage()
|
||||
{
|
||||
double pixelPercentage;
|
||||
pixelPercentage = Location.GetPixelPercentage(1, 1, 10, 10, 100, 100);
|
||||
Assert.IsTrue(pixelPercentage == 0.0505d);
|
||||
pixelPercentage = Location.GetPixelPercentage(50, 50, 60, 60, 100, 100);
|
||||
Assert.IsTrue(pixelPercentage == 0.5555d);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestMethodFace()
|
||||
{
|
||||
string sourceFileName = "IMG_0067.jpg";
|
||||
string sourceDirectoryName = "Mackenzie Prom 2017";
|
||||
// string sourceFileName = "Fall 2005 (113).jpg";
|
||||
// string sourceDirectoryName = "=2005.3 Fall";
|
||||
// string sourceFileName = "DSCN0534.jpg";
|
||||
// string sourceDirectoryName = "Logan Swimming Lessons 2013";
|
||||
// string sourceFileName = "DSC_4913.jpg";
|
||||
// string sourceDirectoryName = "Disneyland 2014";
|
||||
// string sourceFileName = "Logan Michael Sept 08 (193).jpg";
|
||||
// string sourceDirectoryName = "=2008.2 Summer Logan Michael";
|
||||
if (_Configuration.ForceMetadataLastWriteTimeToCreationTime is null)
|
||||
throw new ArgumentNullException(nameof(_Configuration.ForceMetadataLastWriteTimeToCreationTime));
|
||||
if (_Configuration.ForceResizeLastWriteTimeToCreationTime is null)
|
||||
throw new ArgumentNullException(nameof(_Configuration.ForceResizeLastWriteTimeToCreationTime));
|
||||
if (_Configuration.OutputQuality is null)
|
||||
throw new ArgumentNullException(nameof(_Configuration.OutputQuality));
|
||||
if (_Configuration.OverrideForResizeImages is null)
|
||||
throw new ArgumentNullException(nameof(_Configuration.OverrideForResizeImages));
|
||||
if (_Configuration.PropertiesChangedForMetadata is null)
|
||||
throw new ArgumentNullException(nameof(_Configuration.PropertiesChangedForMetadata));
|
||||
if (_Configuration.PropertiesChangedForResize is null)
|
||||
throw new ArgumentNullException(nameof(_Configuration.PropertiesChangedForResize));
|
||||
if (_Configuration.NumberOfJitters is null)
|
||||
throw new ArgumentNullException(nameof(_Configuration.NumberOfJitters));
|
||||
if (_Configuration.NumberOfTimesToUpsample is null)
|
||||
throw new ArgumentNullException(nameof(_Configuration.NumberOfTimesToUpsample));
|
||||
int g = 1;
|
||||
int r = 1;
|
||||
string original = "Original";
|
||||
List<string> parseExceptions = new();
|
||||
Property.Models.A_Property? property = null;
|
||||
Property.Models.PropertyHolder propertyHolder;
|
||||
Dictionary<string, int[]> imageResizeKeyValuePairs;
|
||||
List<Tuple<string, DateTime>> subFileTuples = new();
|
||||
List<KeyValuePair<string, string>> metadataCollection;
|
||||
int length = _PropertyConfiguration.RootDirectory.Length;
|
||||
string outputResolution = _Configuration.OutputResolutions[0];
|
||||
Property.Models.PropertyLogic propertyLogic = GetPropertyLogic();
|
||||
(Model model, PredictorModel predictorModel, ModelParameter modelParameter) = GetModel(_Configuration);
|
||||
string sourceDirectory = Path.Combine(_PropertyConfiguration.RootDirectory, sourceDirectoryName);
|
||||
_Logger.Information(_Configuration.ModelDirectory);
|
||||
string aPropertySingletonDirectory = Property.Models.Stateless.IResult.GetResultsDateGroupDirectory(_PropertyConfiguration, nameof(Property.Models.A_Property), "{}");
|
||||
B_Metadata metadata = new(_Configuration.ForceMetadataLastWriteTimeToCreationTime.Value, _Configuration.PropertiesChangedForMetadata.Value);
|
||||
(ImageCodecInfo imageCodecInfo, EncoderParameters encoderParameters) = C_Resize.GetTuple(_Configuration.OutputExtension, _Configuration.OutputQuality.Value);
|
||||
C_Resize resize = new(_Configuration.ForceResizeLastWriteTimeToCreationTime.Value, _Configuration.OverrideForResizeImages.Value, _Configuration.PropertiesChangedForResize.Value, _Configuration.ValidResolutions, imageCodecInfo, encoderParameters);
|
||||
propertyLogic.AngleBracketCollection.AddRange(Property.Models.Stateless.IResult.GetDirectoryInfoCollection(_PropertyConfiguration,
|
||||
model,
|
||||
predictorModel,
|
||||
sourceDirectory,
|
||||
nameof(Property.Models.A_Property),
|
||||
outputResolution,
|
||||
includeResizeGroup: false,
|
||||
includeModel: false,
|
||||
includePredictorModel: false,
|
||||
contentDescription: string.Empty,
|
||||
singletonDescription: "Properties for each image",
|
||||
collectionDescription: string.Empty));
|
||||
metadata.AngleBracketCollection.AddRange(Property.Models.Stateless.IResult.GetDirectoryInfoCollection(_PropertyConfiguration,
|
||||
model,
|
||||
predictorModel,
|
||||
sourceDirectory,
|
||||
nameof(B_Metadata),
|
||||
outputResolution,
|
||||
includeResizeGroup: false,
|
||||
includeModel: false,
|
||||
includePredictorModel: false,
|
||||
contentDescription: string.Empty,
|
||||
singletonDescription: "Metadata as key value pairs",
|
||||
collectionDescription: string.Empty));
|
||||
resize.AngleBracketCollection.AddRange(Property.Models.Stateless.IResult.GetDirectoryInfoCollection(_PropertyConfiguration,
|
||||
model,
|
||||
predictorModel,
|
||||
sourceDirectory,
|
||||
nameof(C_Resize),
|
||||
outputResolution,
|
||||
includeResizeGroup: true,
|
||||
includeModel: false,
|
||||
includePredictorModel: false,
|
||||
contentDescription: "Resized image",
|
||||
singletonDescription: "Resize dimensions for each resolution",
|
||||
collectionDescription: string.Empty));
|
||||
string sourceDirectoryFile = ".json";
|
||||
FileInfo fileInfo = new(Path.Combine(sourceDirectory, sourceFileName));
|
||||
string relativePath = Property.Models.Stateless.IPath.GetRelativePath(fileInfo.FullName, length);
|
||||
sourceDirectory = Path.Combine(aPropertySingletonDirectory, sourceDirectoryName);
|
||||
propertyHolder = new(g, sourceDirectory, sourceDirectoryFile, relativePath, r, fileInfo, property, false, false, null, null);
|
||||
Assert.IsNotNull(propertyHolder.ImageFileInfo);
|
||||
property = propertyLogic.GetProperty(propertyLogic.AngleBracketCollection[0], propertyHolder, subFileTuples, parseExceptions);
|
||||
(int _, metadataCollection) = metadata.GetMetadataCollection(subFileTuples, parseExceptions, propertyHolder);
|
||||
imageResizeKeyValuePairs = resize.GetResizeKeyValuePairs(subFileTuples, parseExceptions, original, metadataCollection, property, propertyHolder);
|
||||
FileInfo resizedFileInfo = new(Path.Combine(resize.AngleBracketCollection[0].Replace("<>", "()"), Path.GetFileName(propertyHolder.ImageFileInfo.FullName)));
|
||||
propertyHolder.SetResizedFileInfo(resizedFileInfo);
|
||||
resize.SaveResizedSubfile(outputResolution, subFileTuples, propertyHolder, original, property, imageResizeKeyValuePairs);
|
||||
resizedFileInfo.Refresh();
|
||||
Assert.IsNotNull(propertyHolder.ResizedFileInfo);
|
||||
Image? image = FaceRecognition.LoadImageFile(propertyHolder.ResizedFileInfo.FullName);
|
||||
Assert.IsNotNull(image);
|
||||
FaceRecognition faceRecognition = FaceRecognition.Create(modelParameter);
|
||||
List<Location> locations = faceRecognition.FaceLocations(model, image, _Configuration.NumberOfTimesToUpsample.Value, sortByPixelPercentage: true);
|
||||
Assert.IsTrue(locations.Count == 2);
|
||||
List<(FacePart, FacePoint[])[]> faceLandmarks = faceRecognition.GetFaceLandmarkCollection(image, _Configuration.NumberOfTimesToUpsample.Value, locations, predictorModel, model);
|
||||
Assert.IsTrue(faceLandmarks.Count == 2);
|
||||
faceLandmarks = faceRecognition.GetFaceLandmarkCollection(image, _Configuration.NumberOfTimesToUpsample.Value, faceLocations: null, predictorModel, model);
|
||||
Assert.IsTrue(faceLandmarks.Count == 2);
|
||||
List<FaceRecognitionDotNet.FaceEncoding> faceEncodings = faceRecognition.FaceEncodings(image, _Configuration.NumberOfTimesToUpsample.Value, knownFaceLocation: null, _Configuration.NumberOfJitters.Value, predictorModel, model);
|
||||
Assert.IsTrue(faceEncodings.Count == 2);
|
||||
List<double> faceDistances = FaceRecognition.FaceDistances(faceEncodings, faceEncodings[0]);
|
||||
Assert.IsTrue(faceDistances.Count == 2);
|
||||
Assert.IsNotNull(sourceFileName);
|
||||
}
|
||||
|
||||
}
|
526
TestsWithFaceRecognitionDotNet/appsettings.Development.json
Normal file
526
TestsWithFaceRecognitionDotNet/appsettings.Development.json
Normal file
@ -0,0 +1,526 @@
|
||||
{
|
||||
"Company": "Mike Phares",
|
||||
"Linux": {},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Log4netProvider": "Debug",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"MaxDegreeOfParallelism": 6,
|
||||
"Serilog": {
|
||||
"Using": [
|
||||
"Serilog.Sinks.Console",
|
||||
"Serilog.Sinks.File"
|
||||
],
|
||||
"MinimumLevel": "Debug",
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "Debug",
|
||||
"Args": {
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Console",
|
||||
"Args": {
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "File",
|
||||
"Args": {
|
||||
"path": "%workingDirectory% - Log/log-.txt",
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}",
|
||||
"rollingInterval": "Hour"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Enrich": [
|
||||
"FromLogContext",
|
||||
"WithMachineName",
|
||||
"WithThreadId"
|
||||
],
|
||||
"Properties": {
|
||||
"Application": "Sample"
|
||||
}
|
||||
},
|
||||
"WorkingDirectoryName": "PharesApps",
|
||||
"Windows": {
|
||||
"Configuration": {
|
||||
"CheckJsonForDistanceResults": true,
|
||||
"CrossDirectoryMaxItemsInDistanceCollection": 7,
|
||||
"DateGroup": "2022-07-27",
|
||||
"DistanceFactor": 8,
|
||||
"FileNameDirectorySeparator": ".Z.",
|
||||
"ForceMetadataLastWriteTimeToCreationTime": true,
|
||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
||||
"ForceResizeLastWriteTimeToCreationTime": true,
|
||||
"LoadOrCreateThenSaveIndex": false,
|
||||
"LocationConfidenceFactor": 2,
|
||||
"MappedMaxIndex": 1034720,
|
||||
"MaxImagesInDirectoryForTopLevelFirstPass": 50,
|
||||
"MaxItemsInDistanceCollection": 50,
|
||||
"ModelDirectory": "C:/GitHub/dlib-models",
|
||||
"ModelName": "Hog",
|
||||
"NumberOfJitters": 1,
|
||||
"NumberOfTimesToUpsample": 1,
|
||||
"OutputExtension": ".jpg",
|
||||
"OutputQuality": 95,
|
||||
"OverrideForFaceImages": false,
|
||||
"OverrideForFaceLandmarkImages": false,
|
||||
"OverrideForResizeImages": false,
|
||||
"PaddingLoops": 5,
|
||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||
"PredictorModelName": "Large",
|
||||
"PopulatePropertyId": true,
|
||||
"PropertiesChangedForDistance": false,
|
||||
"PropertiesChangedForFaces": false,
|
||||
"PropertiesChangedForIndex": false,
|
||||
"PropertiesChangedForMetadata": false,
|
||||
"PropertiesChangedForProperty": false,
|
||||
"PropertiesChangedForResize": false,
|
||||
"Reverse": false,
|
||||
"xRootDirectory": "C:/Tmp/phares/Pictures",
|
||||
"RootDirectory": "F:/Tmp/Phares/Compare/Images 2022-07-27 - f642c5669a1d89d598a2efd70da9dc7129d02c15 - III",
|
||||
"SaveFullYearOfRandomFiles": true,
|
||||
"SaveResizedSubFiles": true,
|
||||
"SkipSearch": false,
|
||||
"TestDistanceResults": true,
|
||||
"WriteBitmapDataBytes": false,
|
||||
"IgnoreExtensions": [
|
||||
".gif",
|
||||
".GIF"
|
||||
],
|
||||
"JuliePhares": [
|
||||
"1500-01-16_00",
|
||||
"1500-01-19_00",
|
||||
"1500-01-20_00",
|
||||
"1500-01-21_00",
|
||||
"1500-01-25_00",
|
||||
"1500-01-26_00",
|
||||
"1500-01-27_00",
|
||||
"1500-02-13_00",
|
||||
"1500-02-17_00",
|
||||
"1500-02-24_00",
|
||||
"1500-02-25_00",
|
||||
"1500-04-03_00",
|
||||
"1500-04-06_00",
|
||||
"1500-04-19_00",
|
||||
"1500-05-03_00",
|
||||
"1500-05-18_00",
|
||||
"1500-05-28_00",
|
||||
"1500-06-16_00",
|
||||
"1500-06-26_00",
|
||||
"1500-06-27_00",
|
||||
"1500-07-07_00",
|
||||
"1500-07-16_00",
|
||||
"1720-09-30_05",
|
||||
"1500-07-26_00",
|
||||
"1500-08-03_00",
|
||||
"1500-08-23_00",
|
||||
"1500-08-24_00",
|
||||
"1500-09-16_00",
|
||||
"1500-09-21_00",
|
||||
"1500-09-28_00",
|
||||
"1500-10-14_00",
|
||||
"1500-11-07_00",
|
||||
"1500-11-09_00",
|
||||
"1720-09-28_20",
|
||||
"1501-01-08_00",
|
||||
"1501-01-12_00",
|
||||
"1501-01-13_00",
|
||||
"1501-01-30_00",
|
||||
"1501-03-09_00",
|
||||
"1501-03-14_00",
|
||||
"1501-03-22_00",
|
||||
"1501-04-07_00",
|
||||
"1501-04-10_00",
|
||||
"1501-04-19_00",
|
||||
"1501-05-06_00",
|
||||
"1956-09-19_00",
|
||||
"2012-09-17_00",
|
||||
"1998-05-21_00",
|
||||
"1960-03-01_00",
|
||||
"1976-03-08_00",
|
||||
"2007-09-07_00",
|
||||
"2000-04-07_00",
|
||||
"1980-01-17_00",
|
||||
"1958-01-30_00",
|
||||
"1976-01-05_00",
|
||||
"1982-05-02_00"
|
||||
],
|
||||
"LoadOrCreateThenSaveDirectoryDistanceResultsForOutputResolutions": [
|
||||
"1920 x 1080"
|
||||
],
|
||||
"LoadOrCreateThenSaveDistanceResultsForOutputResolutions": [
|
||||
"1920 x 1080"
|
||||
],
|
||||
"LoadOrCreateThenSaveImageFacesResultsForOutputResolutions": [
|
||||
"1920 x 1080"
|
||||
],
|
||||
"OutputResolutions": [
|
||||
"176 x 176",
|
||||
"256 x 256",
|
||||
"353 x 353",
|
||||
"1024 x 768",
|
||||
"1920 x 1080"
|
||||
],
|
||||
"PropertyContentCollectionFiles": [],
|
||||
"SaveFaceLandmarkForOutputResolutions": [
|
||||
"176 x 176",
|
||||
"256 x 256"
|
||||
],
|
||||
"SaveShortcutsForOutputResolutions": [
|
||||
"1920 x 1080"
|
||||
],
|
||||
"ValidImageFormatExtensions": [
|
||||
".bmp",
|
||||
".BMP",
|
||||
".gif",
|
||||
".GIF",
|
||||
".jpeg",
|
||||
".JPEG",
|
||||
".jpg",
|
||||
".JPG",
|
||||
".png",
|
||||
".PNG",
|
||||
".tiff",
|
||||
".TIFF"
|
||||
],
|
||||
"ValidMetadataExtensions": [
|
||||
".3gp",
|
||||
".3GP",
|
||||
".amr",
|
||||
".AMR",
|
||||
".avi",
|
||||
".AVI",
|
||||
".bmp",
|
||||
".BMP",
|
||||
".gif",
|
||||
".GIF",
|
||||
".ico",
|
||||
".ICO",
|
||||
".jpeg",
|
||||
".JPEG",
|
||||
".jpg",
|
||||
".JPG",
|
||||
".m4v",
|
||||
".M4V",
|
||||
".mov",
|
||||
".MOV",
|
||||
".mp4",
|
||||
".MP4",
|
||||
".mta",
|
||||
".MTA",
|
||||
".png",
|
||||
".PNG",
|
||||
".tiff",
|
||||
".TIFF"
|
||||
],
|
||||
"ValidResolutions": [
|
||||
"176 x 176",
|
||||
"256 x 256",
|
||||
"353 x 353",
|
||||
"1024 x 768",
|
||||
"1280 x 720",
|
||||
"1280 x 800",
|
||||
"1376 x 768",
|
||||
"1600 x 1200",
|
||||
"1920 x 1080",
|
||||
"2256 x 1496",
|
||||
"3840 x 2160",
|
||||
"7680 x 4320"
|
||||
],
|
||||
"VerifyToSeason": [
|
||||
". 2000",
|
||||
". 2001",
|
||||
". 2002",
|
||||
". 2003",
|
||||
". 2004",
|
||||
". 2005",
|
||||
". 2006",
|
||||
". 2007",
|
||||
". 2008",
|
||||
". 2009",
|
||||
". 2010",
|
||||
". 2011",
|
||||
". 2012",
|
||||
". 2013",
|
||||
". 2014",
|
||||
". 2015",
|
||||
". 2016",
|
||||
". 2017",
|
||||
". 2018",
|
||||
". 2019",
|
||||
". 2020",
|
||||
". 2021",
|
||||
". 2022",
|
||||
". 2023",
|
||||
". 2024",
|
||||
". 2025",
|
||||
". 2026",
|
||||
". 2027",
|
||||
". 2028",
|
||||
". 2029",
|
||||
"=2000.0 Winter",
|
||||
"=2002.1 Spring",
|
||||
"=2002.4 Winter",
|
||||
"=2003.0 Winter",
|
||||
"=2003.1 Spring",
|
||||
"=2003.3 Fall",
|
||||
"=2003.4 Winter",
|
||||
"=2004.0 Winter",
|
||||
"=2005.1 Spring",
|
||||
"=2005.2 Summer",
|
||||
"=2005.3 Fall",
|
||||
"=2005.4 Winter",
|
||||
"=2006.0 Winter",
|
||||
"=2006.1 Spring",
|
||||
"=2006.3 Fall",
|
||||
"=2007.0 Winter",
|
||||
"=2007.2 Summer Logan Michael",
|
||||
"=2007.2 Summer",
|
||||
"=2007.3 Fall Logan Michael",
|
||||
"=2007.4 Winter Logan Michael",
|
||||
"=2008.0 Winter Logan Michael",
|
||||
"=2008.1 Spring Logan Michael",
|
||||
"=2008.2 Summer Logan Michael",
|
||||
"=2008.2 Summer",
|
||||
"=2008.3 Fall Logan Michael",
|
||||
"=2009.0 Winter Logan Michael",
|
||||
"=2009.0 Winter",
|
||||
"=2009.1 Spring Logan Michael",
|
||||
"=2009.1 Spring",
|
||||
"=2009.2 Summer Logan Michael",
|
||||
"=2009.2 Summer",
|
||||
"=2009.3 Fall Logan Michael",
|
||||
"=2009.3 Fall",
|
||||
"=2009.4 Winter Logan Michael",
|
||||
"=2009.4 Winter",
|
||||
"=2010.0 Winter Logan Michael",
|
||||
"=2010.0 Winter",
|
||||
"=2010.1 Spring Logan Michael",
|
||||
"=2010.1 Spring",
|
||||
"=2010.2 Summer",
|
||||
"=2010.3 Fall Logan Michael",
|
||||
"=2010.3 Fall",
|
||||
"=2010.4 Winter",
|
||||
"=2011.0 Winter",
|
||||
"=2011.1 Spring",
|
||||
"=2011.2 Summer",
|
||||
"=2011.3 Fall",
|
||||
"=2011.4 Winter",
|
||||
"=2012.0 Winter Chelsea 2012",
|
||||
"=2012.0 Winter Chelsea",
|
||||
"=2012.0 Winter",
|
||||
"=2012.1 Spring Chelsea",
|
||||
"=2012.1 Spring",
|
||||
"=2012.2 Summer Chelsea",
|
||||
"=2012.2 Summer",
|
||||
"=2012.3 Fall Chelsea",
|
||||
"=2012.3 Fall",
|
||||
"=2012.4 Winter Chelsea",
|
||||
"=2012.4 Winter",
|
||||
"=2013.0 Winter Chelsea 2013",
|
||||
"=2013.0 Winter Chelsea",
|
||||
"=2013.0 Winter",
|
||||
"=2013.1 Spring",
|
||||
"=2013.2 Summer Chelsea",
|
||||
"=2013.2 Summer",
|
||||
"=2013.3 Fall Chelsea",
|
||||
"=2013.3 Fall",
|
||||
"=2013.4 Winter",
|
||||
"=2014.0 Winter",
|
||||
"=2014.1 Spring",
|
||||
"=2014.2 Summer",
|
||||
"=2014.3 Fall",
|
||||
"=2014.4 Winter",
|
||||
"=2015.0 Winter",
|
||||
"=2015.1 Spring",
|
||||
"=2015.2 Summer",
|
||||
"=2015.3 Fall",
|
||||
"=2015.4 Winter",
|
||||
"=2016.0 Winter",
|
||||
"=2016.1 Spring",
|
||||
"=2016.2 Summer",
|
||||
"=2016.3 Fall",
|
||||
"=2016.4 Winter",
|
||||
"=2017.1 Spring",
|
||||
"=2017.2 Summer",
|
||||
"=2017.3 Fall",
|
||||
"=2017.4 Winter",
|
||||
"=2018.0 Winter",
|
||||
"=2018.1 Spring",
|
||||
"=2018.3 Fall",
|
||||
"=2018.4 Winter",
|
||||
"=2019.0 Winter",
|
||||
"=2019.1 Spring",
|
||||
"=2019.2 Summer",
|
||||
"=2019.3 Fall",
|
||||
"=2019.4 Winter",
|
||||
"=2020.0 Winter",
|
||||
"=2020.1 Spring",
|
||||
"=2020.2 Summer",
|
||||
"=2020.3 Fall",
|
||||
"=2020.4 Winter",
|
||||
"=2021.1 Spring",
|
||||
"=2021.2 Summer",
|
||||
"=2021.3 Fall",
|
||||
"=2021.4 Winter",
|
||||
"=2022.0 Winter",
|
||||
"=2022.1 Spring",
|
||||
"Anthem 2015",
|
||||
"April 2010",
|
||||
"April 2013",
|
||||
"December 2006",
|
||||
"December 2010",
|
||||
"Fall 2005",
|
||||
"Fall 2015",
|
||||
"Fall 2016",
|
||||
"Fall 2017",
|
||||
"Fall 2018",
|
||||
"Fall 2019",
|
||||
"Fall 2020",
|
||||
"Fall 2021",
|
||||
"February 2010",
|
||||
"January 2015",
|
||||
"July 2010",
|
||||
"June 2010",
|
||||
"Kids 2005",
|
||||
"March 2013",
|
||||
"May 2010",
|
||||
"May 2011",
|
||||
"May 2013",
|
||||
"October 2005",
|
||||
"October 2014",
|
||||
"Spring 2013",
|
||||
"Spring 2014",
|
||||
"Spring 2016",
|
||||
"Spring 2018",
|
||||
"Spring 2019",
|
||||
"Spring 2020",
|
||||
"Summer 2011",
|
||||
"Summer 2012",
|
||||
"Summer 2013",
|
||||
"Summer 2014",
|
||||
"Summer 2015",
|
||||
"Summer 2016",
|
||||
"Summer 2017",
|
||||
"Summer 2018",
|
||||
"Summer 2020",
|
||||
"Summer 2021",
|
||||
"Winter 2015",
|
||||
"Winter 2016",
|
||||
"Winter 2017",
|
||||
"Winter 2018",
|
||||
"Winter 2019-2020",
|
||||
"Winter 2020",
|
||||
"zzz =2005.0 Winter Tracy Pictures",
|
||||
"zzz =2005.1 Spring Tracy Pictures",
|
||||
"zzz =2005.2 Summer Tracy Pictures",
|
||||
"zzz =2005.3 Fall Tracy Pictures",
|
||||
"zzz =2005.4 Winter Tracy Pictures",
|
||||
"zzz =2006.1 Spring Tracy Pictures",
|
||||
"zzz =2007.0 Winter Tracy Pictures",
|
||||
"zzz =2007.2 Summer Tracy Pictures",
|
||||
"zzz =2008.0 Winter Tracy Pictures",
|
||||
"zzz =2008.2 Summer Tracy Pictures",
|
||||
"zzz =2009.0 Winter Tracy Pictures",
|
||||
"zzz =2009.2 Summer Tracy Pictures",
|
||||
"zzz =2009.3 Fall Tracy Pictures",
|
||||
"zzz =2009.4 Winter Tracy Pictures",
|
||||
"zzz =2010.0 Winter Tracy Pictures",
|
||||
"zzz =2010.1 Spring Tracy Pictures",
|
||||
"zzz =2010.2 Summer Tracy Pictures",
|
||||
"zzz =2010.3 Fall Tracy Pictures",
|
||||
"zzz =2011.0 Winter Tracy Pictures",
|
||||
"zzz =2011.1 Spring Tracy Pictures",
|
||||
"zzz =2011.2 Summer Tracy Pictures",
|
||||
"zzz =2011.3 Fall Tracy Pictures",
|
||||
"zzz =2011.4 Winter Tracy Pictures",
|
||||
"zzz =2012.0 Winter Tracy Pictures",
|
||||
"zzz =2012.1 Spring Tracy Pictures",
|
||||
"zzz =2012.2 Summer Tracy Pictures",
|
||||
"zzz =2012.3 Fall Tracy Pictures",
|
||||
"zzz =2012.4 Winter Tracy Pictures",
|
||||
"zzz =2013.0 Winter Tracy Pictures",
|
||||
"zzz =2013.1 Spring Tracy Pictures",
|
||||
"zzz =2013.2 Summer Tracy Pictures",
|
||||
"zzz =2013.3 Fall Tracy Pictures",
|
||||
"zzz =2013.4 Winter Tracy Pictures",
|
||||
"zzz =2014.0 Winter Tracy Pictures",
|
||||
"zzz =2014.1 Spring Tracy Pictures",
|
||||
"zzz =2014.2 Summer Tracy Pictures",
|
||||
"zzz =2014.3 Fall Tracy Pictures",
|
||||
"zzz =2014.4 Winter Tracy Pictures",
|
||||
"zzz =2015.0 Winter Tracy Pictures"
|
||||
],
|
||||
"MixedYearRelativePaths": [
|
||||
"Edited",
|
||||
"Phares Slides",
|
||||
"Rex Memorial",
|
||||
"Scanned Grandma's Quilt",
|
||||
"Scanned Pictures Of Kids",
|
||||
"Scanned Prints",
|
||||
"Slide in Name Order Originals (622)",
|
||||
"Slides Pictures"
|
||||
],
|
||||
"IgnoreRelativePaths": [
|
||||
"3757 W Whitman 2017",
|
||||
"501 Playful Meadows 2006",
|
||||
"501 Playful Meadows 2007",
|
||||
"501 Playful Meadows 2008",
|
||||
"501 Playful Meadows 2009",
|
||||
"501 Playful Meadows 2010",
|
||||
"501 Playful Meadows 2013",
|
||||
"501 Playful Meadows 2015",
|
||||
"6309 Evesham 2003",
|
||||
"6309 Evesham 2004",
|
||||
"Crystal's Wedding 2003",
|
||||
"Danny's Wedding 2009",
|
||||
"Door images 2019",
|
||||
"Family Pictures 2006",
|
||||
"Family Pictures 2007",
|
||||
"Family Pictures 2011",
|
||||
"Family Pictures 2013",
|
||||
"GrandPrix 2004",
|
||||
"Kids School Pictures 2004",
|
||||
"Kristy 2002",
|
||||
"Kristy Parents Wedding 2005",
|
||||
"Logan Ultrasound 2007",
|
||||
"Mandy's Dogs 2008",
|
||||
"Motorcycles 2010",
|
||||
"Motorcycles 2013",
|
||||
"Motorcycles 2014",
|
||||
"Phares Slides",
|
||||
"Portrait Innovations April 2008",
|
||||
"Portrait Innovations December 2007",
|
||||
"Portrait Innovations June 2008",
|
||||
"Portrait Innovations March 2012",
|
||||
"The guys house 2000",
|
||||
"Tracy Pictures 2005",
|
||||
"Tracy Pictures 2006",
|
||||
"Tracy Pictures 2007",
|
||||
"Tracy Pictures 2008",
|
||||
"Tracy Pictures 2009",
|
||||
"Tracy Pictures 2010",
|
||||
"Tracy Pictures 2011",
|
||||
"Tracy Pictures 2012",
|
||||
"Tracy Pictures 2013 Jan-July",
|
||||
"Tracy Pictures 2013 July- Dec",
|
||||
"Tracy Pictures 2014",
|
||||
"Tracy Pictures 2015",
|
||||
"Tracy Took The Kids 2006",
|
||||
"Tracy's Bday 2012",
|
||||
"Tracy's Wedding 2002",
|
||||
"Trip to Colorado 10 2002",
|
||||
"Trip to Colorado June 2002",
|
||||
"Tub 2002",
|
||||
"Vericruz 2011"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
525
TestsWithFaceRecognitionDotNet/appsettings.json
Normal file
525
TestsWithFaceRecognitionDotNet/appsettings.json
Normal file
@ -0,0 +1,525 @@
|
||||
{
|
||||
"Company": "Mike Phares",
|
||||
"Linux": {},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Log4netProvider": "Information",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"MaxDegreeOfParallelism": 12,
|
||||
"Serilog": {
|
||||
"Using": [
|
||||
"Serilog.Sinks.Console",
|
||||
"Serilog.Sinks.File"
|
||||
],
|
||||
"MinimumLevel": "Debug",
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "Debug",
|
||||
"Args": {
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Console",
|
||||
"Args": {
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "File",
|
||||
"Args": {
|
||||
"path": "%workingDirectory% - Log/log-.txt",
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}",
|
||||
"rollingInterval": "Hour"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Enrich": [
|
||||
"FromLogContext",
|
||||
"WithMachineName",
|
||||
"WithThreadId"
|
||||
],
|
||||
"Properties": {
|
||||
"Application": "Sample"
|
||||
}
|
||||
},
|
||||
"WorkingDirectoryName": "PharesApps",
|
||||
"Windows": {
|
||||
"Configuration": {
|
||||
"CheckJsonForDistanceResults": true,
|
||||
"CrossDirectoryMaxItemsInDistanceCollection": 7,
|
||||
"DateGroup": "2022-07-27",
|
||||
"DistanceFactor": 8,
|
||||
"FileNameDirectorySeparator": ".Z.",
|
||||
"ForceMetadataLastWriteTimeToCreationTime": false,
|
||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
||||
"ForceResizeLastWriteTimeToCreationTime": false,
|
||||
"LoadOrCreateThenSaveIndex": false,
|
||||
"LocationConfidenceFactor": 2,
|
||||
"MappedMaxIndex": 1034720,
|
||||
"MaxImagesInDirectoryForTopLevelFirstPass": 50,
|
||||
"MaxItemsInDistanceCollection": 50,
|
||||
"ModelDirectory": "C:/GitHub/dlib-models",
|
||||
"ModelName": "Hog",
|
||||
"NumberOfJitters": 1,
|
||||
"NumberOfTimesToUpsample": 1,
|
||||
"OutputExtension": ".jpg",
|
||||
"OutputQuality": 95,
|
||||
"OverrideForFaceImages": false,
|
||||
"OverrideForFaceLandmarkImages": false,
|
||||
"OverrideForResizeImages": false,
|
||||
"PaddingLoops": 5,
|
||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||
"PopulatePropertyId": true,
|
||||
"PredictorModelName": "Large",
|
||||
"PropertiesChangedForDistance": false,
|
||||
"PropertiesChangedForFaces": false,
|
||||
"PropertiesChangedForIndex": false,
|
||||
"PropertiesChangedForMetadata": false,
|
||||
"PropertiesChangedForProperty": false,
|
||||
"PropertiesChangedForResize": false,
|
||||
"Reverse": false,
|
||||
"RootDirectory": "D:/Images",
|
||||
"SaveFullYearOfRandomFiles": true,
|
||||
"SaveResizedSubFiles": true,
|
||||
"SkipSearch": false,
|
||||
"TestDistanceResults": true,
|
||||
"WriteBitmapDataBytes": false,
|
||||
"IgnoreExtensions": [
|
||||
".gif",
|
||||
".GIF"
|
||||
],
|
||||
"JuliePhares": [
|
||||
"1500-01-16_00",
|
||||
"1500-01-19_00",
|
||||
"1500-01-20_00",
|
||||
"1500-01-21_00",
|
||||
"1500-01-25_00",
|
||||
"1500-01-26_00",
|
||||
"1500-01-27_00",
|
||||
"1500-02-13_00",
|
||||
"1500-02-17_00",
|
||||
"1500-02-24_00",
|
||||
"1500-02-25_00",
|
||||
"1500-04-03_00",
|
||||
"1500-04-06_00",
|
||||
"1500-04-19_00",
|
||||
"1500-05-03_00",
|
||||
"1500-05-18_00",
|
||||
"1500-05-28_00",
|
||||
"1500-06-16_00",
|
||||
"1500-06-26_00",
|
||||
"1500-06-27_00",
|
||||
"1500-07-07_00",
|
||||
"1500-07-16_00",
|
||||
"1720-09-30_05",
|
||||
"1500-07-26_00",
|
||||
"1500-08-03_00",
|
||||
"1500-08-23_00",
|
||||
"1500-08-24_00",
|
||||
"1500-09-16_00",
|
||||
"1500-09-21_00",
|
||||
"1500-09-28_00",
|
||||
"1500-10-14_00",
|
||||
"1500-11-07_00",
|
||||
"1500-11-09_00",
|
||||
"1720-09-28_20",
|
||||
"1501-01-08_00",
|
||||
"1501-01-12_00",
|
||||
"1501-01-13_00",
|
||||
"1501-01-30_00",
|
||||
"1501-03-09_00",
|
||||
"1501-03-14_00",
|
||||
"1501-03-22_00",
|
||||
"1501-04-07_00",
|
||||
"1501-04-10_00",
|
||||
"1501-04-19_00",
|
||||
"1501-05-06_00",
|
||||
"1956-09-19_00",
|
||||
"2012-09-17_00",
|
||||
"1998-05-21_00",
|
||||
"1960-03-01_00",
|
||||
"1976-03-08_00",
|
||||
"2007-09-07_00",
|
||||
"2000-04-07_00",
|
||||
"1980-01-17_00",
|
||||
"1958-01-30_00",
|
||||
"1976-01-05_00",
|
||||
"1982-05-02_00"
|
||||
],
|
||||
"LoadOrCreateThenSaveDirectoryDistanceResultsForOutputResolutions": [
|
||||
"1920 x 1080"
|
||||
],
|
||||
"LoadOrCreateThenSaveDistanceResultsForOutputResolutions": [
|
||||
"1920 x 1080"
|
||||
],
|
||||
"LoadOrCreateThenSaveImageFacesResultsForOutputResolutions": [
|
||||
"1920 x 1080"
|
||||
],
|
||||
"OutputResolutions": [
|
||||
"176 x 176",
|
||||
"256 x 256",
|
||||
"353 x 353",
|
||||
"1024 x 768",
|
||||
"1920 x 1080"
|
||||
],
|
||||
"PropertyContentCollectionFiles": [],
|
||||
"SaveFaceLandmarkForOutputResolutions": [
|
||||
"176 x 176",
|
||||
"256 x 256"
|
||||
],
|
||||
"SaveShortcutsForOutputResolutions": [
|
||||
"1920 x 1080"
|
||||
],
|
||||
"ValidImageFormatExtensions": [
|
||||
".bmp",
|
||||
".BMP",
|
||||
".gif",
|
||||
".GIF",
|
||||
".jpeg",
|
||||
".JPEG",
|
||||
".jpg",
|
||||
".JPG",
|
||||
".png",
|
||||
".PNG",
|
||||
".tiff",
|
||||
".TIFF"
|
||||
],
|
||||
"ValidMetadataExtensions": [
|
||||
".3gp",
|
||||
".3GP",
|
||||
".amr",
|
||||
".AMR",
|
||||
".avi",
|
||||
".AVI",
|
||||
".bmp",
|
||||
".BMP",
|
||||
".gif",
|
||||
".GIF",
|
||||
".ico",
|
||||
".ICO",
|
||||
".jpeg",
|
||||
".JPEG",
|
||||
".jpg",
|
||||
".JPG",
|
||||
".m4v",
|
||||
".M4V",
|
||||
".mov",
|
||||
".MOV",
|
||||
".mp4",
|
||||
".MP4",
|
||||
".mta",
|
||||
".MTA",
|
||||
".png",
|
||||
".PNG",
|
||||
".tiff",
|
||||
".TIFF"
|
||||
],
|
||||
"ValidResolutions": [
|
||||
"176 x 176",
|
||||
"256 x 256",
|
||||
"353 x 353",
|
||||
"1024 x 768",
|
||||
"1280 x 720",
|
||||
"1280 x 800",
|
||||
"1376 x 768",
|
||||
"1600 x 1200",
|
||||
"1920 x 1080",
|
||||
"2256 x 1496",
|
||||
"3840 x 2160",
|
||||
"7680 x 4320"
|
||||
],
|
||||
"VerifyToSeason": [
|
||||
". 2000",
|
||||
". 2001",
|
||||
". 2002",
|
||||
". 2003",
|
||||
". 2004",
|
||||
". 2005",
|
||||
". 2006",
|
||||
". 2007",
|
||||
". 2008",
|
||||
". 2009",
|
||||
". 2010",
|
||||
". 2011",
|
||||
". 2012",
|
||||
". 2013",
|
||||
". 2014",
|
||||
". 2015",
|
||||
". 2016",
|
||||
". 2017",
|
||||
". 2018",
|
||||
". 2019",
|
||||
". 2020",
|
||||
". 2021",
|
||||
". 2022",
|
||||
". 2023",
|
||||
". 2024",
|
||||
". 2025",
|
||||
". 2026",
|
||||
". 2027",
|
||||
". 2028",
|
||||
". 2029",
|
||||
"=2000.0 Winter",
|
||||
"=2002.1 Spring",
|
||||
"=2002.4 Winter",
|
||||
"=2003.0 Winter",
|
||||
"=2003.1 Spring",
|
||||
"=2003.3 Fall",
|
||||
"=2003.4 Winter",
|
||||
"=2004.0 Winter",
|
||||
"=2005.1 Spring",
|
||||
"=2005.2 Summer",
|
||||
"=2005.3 Fall",
|
||||
"=2005.4 Winter",
|
||||
"=2006.0 Winter",
|
||||
"=2006.1 Spring",
|
||||
"=2006.3 Fall",
|
||||
"=2007.0 Winter",
|
||||
"=2007.2 Summer Logan Michael",
|
||||
"=2007.2 Summer",
|
||||
"=2007.3 Fall Logan Michael",
|
||||
"=2007.4 Winter Logan Michael",
|
||||
"=2008.0 Winter Logan Michael",
|
||||
"=2008.1 Spring Logan Michael",
|
||||
"=2008.2 Summer Logan Michael",
|
||||
"=2008.2 Summer",
|
||||
"=2008.3 Fall Logan Michael",
|
||||
"=2009.0 Winter Logan Michael",
|
||||
"=2009.0 Winter",
|
||||
"=2009.1 Spring Logan Michael",
|
||||
"=2009.1 Spring",
|
||||
"=2009.2 Summer Logan Michael",
|
||||
"=2009.2 Summer",
|
||||
"=2009.3 Fall Logan Michael",
|
||||
"=2009.3 Fall",
|
||||
"=2009.4 Winter Logan Michael",
|
||||
"=2009.4 Winter",
|
||||
"=2010.0 Winter Logan Michael",
|
||||
"=2010.0 Winter",
|
||||
"=2010.1 Spring Logan Michael",
|
||||
"=2010.1 Spring",
|
||||
"=2010.2 Summer",
|
||||
"=2010.3 Fall Logan Michael",
|
||||
"=2010.3 Fall",
|
||||
"=2010.4 Winter",
|
||||
"=2011.0 Winter",
|
||||
"=2011.1 Spring",
|
||||
"=2011.2 Summer",
|
||||
"=2011.3 Fall",
|
||||
"=2011.4 Winter",
|
||||
"=2012.0 Winter Chelsea 2012",
|
||||
"=2012.0 Winter Chelsea",
|
||||
"=2012.0 Winter",
|
||||
"=2012.1 Spring Chelsea",
|
||||
"=2012.1 Spring",
|
||||
"=2012.2 Summer Chelsea",
|
||||
"=2012.2 Summer",
|
||||
"=2012.3 Fall Chelsea",
|
||||
"=2012.3 Fall",
|
||||
"=2012.4 Winter Chelsea",
|
||||
"=2012.4 Winter",
|
||||
"=2013.0 Winter Chelsea 2013",
|
||||
"=2013.0 Winter Chelsea",
|
||||
"=2013.0 Winter",
|
||||
"=2013.1 Spring",
|
||||
"=2013.2 Summer Chelsea",
|
||||
"=2013.2 Summer",
|
||||
"=2013.3 Fall Chelsea",
|
||||
"=2013.3 Fall",
|
||||
"=2013.4 Winter",
|
||||
"=2014.0 Winter",
|
||||
"=2014.1 Spring",
|
||||
"=2014.2 Summer",
|
||||
"=2014.3 Fall",
|
||||
"=2014.4 Winter",
|
||||
"=2015.0 Winter",
|
||||
"=2015.1 Spring",
|
||||
"=2015.2 Summer",
|
||||
"=2015.3 Fall",
|
||||
"=2015.4 Winter",
|
||||
"=2016.0 Winter",
|
||||
"=2016.1 Spring",
|
||||
"=2016.2 Summer",
|
||||
"=2016.3 Fall",
|
||||
"=2016.4 Winter",
|
||||
"=2017.1 Spring",
|
||||
"=2017.2 Summer",
|
||||
"=2017.3 Fall",
|
||||
"=2017.4 Winter",
|
||||
"=2018.0 Winter",
|
||||
"=2018.1 Spring",
|
||||
"=2018.3 Fall",
|
||||
"=2018.4 Winter",
|
||||
"=2019.0 Winter",
|
||||
"=2019.1 Spring",
|
||||
"=2019.2 Summer",
|
||||
"=2019.3 Fall",
|
||||
"=2019.4 Winter",
|
||||
"=2020.0 Winter",
|
||||
"=2020.1 Spring",
|
||||
"=2020.2 Summer",
|
||||
"=2020.3 Fall",
|
||||
"=2020.4 Winter",
|
||||
"=2021.1 Spring",
|
||||
"=2021.2 Summer",
|
||||
"=2021.3 Fall",
|
||||
"=2021.4 Winter",
|
||||
"=2022.0 Winter",
|
||||
"=2022.1 Spring",
|
||||
"Anthem 2015",
|
||||
"April 2010",
|
||||
"April 2013",
|
||||
"December 2006",
|
||||
"December 2010",
|
||||
"Fall 2005",
|
||||
"Fall 2015",
|
||||
"Fall 2016",
|
||||
"Fall 2017",
|
||||
"Fall 2018",
|
||||
"Fall 2019",
|
||||
"Fall 2020",
|
||||
"Fall 2021",
|
||||
"February 2010",
|
||||
"January 2015",
|
||||
"July 2010",
|
||||
"June 2010",
|
||||
"Kids 2005",
|
||||
"March 2013",
|
||||
"May 2010",
|
||||
"May 2011",
|
||||
"May 2013",
|
||||
"October 2005",
|
||||
"October 2014",
|
||||
"Spring 2013",
|
||||
"Spring 2014",
|
||||
"Spring 2016",
|
||||
"Spring 2018",
|
||||
"Spring 2019",
|
||||
"Spring 2020",
|
||||
"Summer 2011",
|
||||
"Summer 2012",
|
||||
"Summer 2013",
|
||||
"Summer 2014",
|
||||
"Summer 2015",
|
||||
"Summer 2016",
|
||||
"Summer 2017",
|
||||
"Summer 2018",
|
||||
"Summer 2020",
|
||||
"Summer 2021",
|
||||
"Winter 2015",
|
||||
"Winter 2016",
|
||||
"Winter 2017",
|
||||
"Winter 2018",
|
||||
"Winter 2019-2020",
|
||||
"Winter 2020",
|
||||
"zzz =2005.0 Winter Tracy Pictures",
|
||||
"zzz =2005.1 Spring Tracy Pictures",
|
||||
"zzz =2005.2 Summer Tracy Pictures",
|
||||
"zzz =2005.3 Fall Tracy Pictures",
|
||||
"zzz =2005.4 Winter Tracy Pictures",
|
||||
"zzz =2006.1 Spring Tracy Pictures",
|
||||
"zzz =2007.0 Winter Tracy Pictures",
|
||||
"zzz =2007.2 Summer Tracy Pictures",
|
||||
"zzz =2008.0 Winter Tracy Pictures",
|
||||
"zzz =2008.2 Summer Tracy Pictures",
|
||||
"zzz =2009.0 Winter Tracy Pictures",
|
||||
"zzz =2009.2 Summer Tracy Pictures",
|
||||
"zzz =2009.3 Fall Tracy Pictures",
|
||||
"zzz =2009.4 Winter Tracy Pictures",
|
||||
"zzz =2010.0 Winter Tracy Pictures",
|
||||
"zzz =2010.1 Spring Tracy Pictures",
|
||||
"zzz =2010.2 Summer Tracy Pictures",
|
||||
"zzz =2010.3 Fall Tracy Pictures",
|
||||
"zzz =2011.0 Winter Tracy Pictures",
|
||||
"zzz =2011.1 Spring Tracy Pictures",
|
||||
"zzz =2011.2 Summer Tracy Pictures",
|
||||
"zzz =2011.3 Fall Tracy Pictures",
|
||||
"zzz =2011.4 Winter Tracy Pictures",
|
||||
"zzz =2012.0 Winter Tracy Pictures",
|
||||
"zzz =2012.1 Spring Tracy Pictures",
|
||||
"zzz =2012.2 Summer Tracy Pictures",
|
||||
"zzz =2012.3 Fall Tracy Pictures",
|
||||
"zzz =2012.4 Winter Tracy Pictures",
|
||||
"zzz =2013.0 Winter Tracy Pictures",
|
||||
"zzz =2013.1 Spring Tracy Pictures",
|
||||
"zzz =2013.2 Summer Tracy Pictures",
|
||||
"zzz =2013.3 Fall Tracy Pictures",
|
||||
"zzz =2013.4 Winter Tracy Pictures",
|
||||
"zzz =2014.0 Winter Tracy Pictures",
|
||||
"zzz =2014.1 Spring Tracy Pictures",
|
||||
"zzz =2014.2 Summer Tracy Pictures",
|
||||
"zzz =2014.3 Fall Tracy Pictures",
|
||||
"zzz =2014.4 Winter Tracy Pictures",
|
||||
"zzz =2015.0 Winter Tracy Pictures"
|
||||
],
|
||||
"MixedYearRelativePaths": [
|
||||
"Edited",
|
||||
"Phares Slides",
|
||||
"Rex Memorial",
|
||||
"Scanned Grandma's Quilt",
|
||||
"Scanned Pictures Of Kids",
|
||||
"Scanned Prints",
|
||||
"Slide in Name Order Originals (622)",
|
||||
"Slides Pictures"
|
||||
],
|
||||
"IgnoreRelativePaths": [
|
||||
"3757 W Whitman 2017",
|
||||
"501 Playful Meadows 2006",
|
||||
"501 Playful Meadows 2007",
|
||||
"501 Playful Meadows 2008",
|
||||
"501 Playful Meadows 2009",
|
||||
"501 Playful Meadows 2010",
|
||||
"501 Playful Meadows 2013",
|
||||
"501 Playful Meadows 2015",
|
||||
"6309 Evesham 2003",
|
||||
"6309 Evesham 2004",
|
||||
"Crystal's Wedding 2003",
|
||||
"Danny's Wedding 2009",
|
||||
"Door images 2019",
|
||||
"Family Pictures 2006",
|
||||
"Family Pictures 2007",
|
||||
"Family Pictures 2011",
|
||||
"Family Pictures 2013",
|
||||
"GrandPrix 2004",
|
||||
"Kids School Pictures 2004",
|
||||
"Kristy 2002",
|
||||
"Kristy Parents Wedding 2005",
|
||||
"Logan Ultrasound 2007",
|
||||
"Mandy's Dogs 2008",
|
||||
"Motorcycles 2010",
|
||||
"Motorcycles 2013",
|
||||
"Motorcycles 2014",
|
||||
"Phares Slides",
|
||||
"Portrait Innovations April 2008",
|
||||
"Portrait Innovations December 2007",
|
||||
"Portrait Innovations June 2008",
|
||||
"Portrait Innovations March 2012",
|
||||
"The guys house 2000",
|
||||
"Tracy Pictures 2005",
|
||||
"Tracy Pictures 2006",
|
||||
"Tracy Pictures 2007",
|
||||
"Tracy Pictures 2008",
|
||||
"Tracy Pictures 2009",
|
||||
"Tracy Pictures 2010",
|
||||
"Tracy Pictures 2011",
|
||||
"Tracy Pictures 2012",
|
||||
"Tracy Pictures 2013 Jan-July",
|
||||
"Tracy Pictures 2013 July- Dec",
|
||||
"Tracy Pictures 2014",
|
||||
"Tracy Pictures 2015",
|
||||
"Tracy Took The Kids 2006",
|
||||
"Tracy's Bday 2012",
|
||||
"Tracy's Wedding 2002",
|
||||
"Trip to Colorado 10 2002",
|
||||
"Trip to Colorado June 2002",
|
||||
"Tub 2002",
|
||||
"Vericruz 2011"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user