Added Class Library FaceRecognitionDotNet
This commit is contained in:
@ -1,15 +1,16 @@
|
||||
using FaceRecognitionDotNet;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Phares.Shared;
|
||||
using ShellProgressBar;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Text.Json;
|
||||
using View_by_Distance.FaceRecognitionDotNet;
|
||||
using View_by_Distance.Instance.Models;
|
||||
using View_by_Distance.Metadata.Models;
|
||||
using View_by_Distance.Property.Models;
|
||||
using View_by_Distance.Resize.Models;
|
||||
using View_by_Distance.Shared.Models;
|
||||
using View_by_Distance.Shared.Models.Methods;
|
||||
using View_by_Distance.Shared.Models.Stateless;
|
||||
|
||||
namespace View_by_Distance.Instance;
|
||||
|
||||
@ -548,7 +549,7 @@ public class DlibDotNet
|
||||
}
|
||||
}
|
||||
|
||||
private void FullDoWork(Property.Models.Configuration configuration, string[] juliePhares, Model model, PredictorModel predictorModel, string argZero, Person[] people, PropertyLogic propertyLogic, List<PropertyHolder[]> propertyHolderCollections)
|
||||
private void FullDoWork(Property.Models.Configuration configuration, string[] juliePhares, Model model, PredictorModel predictorModel, string argZero, Dictionary<string, List<Person>> peopleCollection, PropertyLogic propertyLogic, List<PropertyHolder[]> propertyHolderCollections)
|
||||
{
|
||||
if (_Log is null)
|
||||
throw new Exception($"{nameof(_Log)} is null!");
|
||||
@ -673,8 +674,10 @@ public class DlibDotNet
|
||||
_Exceptions.Add(sourceDirectory);
|
||||
if (exceptionCount == 0 && _ArgZeroIsConfigurationRootDirectory)
|
||||
WriteGroup(configuration, propertyLogic, propertyCollection, metadataCollection, faceCollections, resizeKeyValuePairs, sourceDirectory, filteredPropertyHolderCollection);
|
||||
if (exceptionCount == 0 && _Configuration.LoadOrCreateThenSaveImageFacesResults.Value && _Configuration.SaveShortcuts.HasValue && _Configuration.SaveShortcuts.Value)
|
||||
_Faces.SaveShortcuts(configuration, juliePhares, model, predictorModel, people, propertyLogic, outputResolution, filteredPropertyHolderCollection, propertyCollection, faceCollections);
|
||||
if (exceptionCount == 0)
|
||||
propertyLogic.AddToPropertyLogicAllCollection(filteredPropertyHolderCollection);
|
||||
if (exceptionCount == 0 && _Configuration.LoadOrCreateThenSaveImageFacesResults.Value && _Configuration.SaveShortcuts.HasValue && _Configuration.SaveShortcuts.Value && propertyLogic.NamedFaceInfoDeterministicHashCodeIndices.Any())
|
||||
_Faces.SaveShortcuts(configuration, juliePhares, model, predictorModel, propertyLogic, peopleCollection, outputResolution, filteredPropertyHolderCollection, propertyCollection, faceCollections);
|
||||
if (exceptionCount == 0 && _Configuration.LoadOrCreateThenSaveDistanceResults.HasValue && _Configuration.LoadOrCreateThenSaveDistanceResults.Value)
|
||||
_Distance.LoadOrCreateThenSaveDistanceResults(configuration, model, predictorModel, sourceDirectory, outputResolution, sourceDirectoryChanges, filteredPropertyHolderCollection, faceCollections);
|
||||
if (_Resize.AngleBracketCollection.Any())
|
||||
@ -696,6 +699,7 @@ public class DlibDotNet
|
||||
}
|
||||
if (_ArgZeroIsConfigurationRootDirectory && outputResolution == _Configuration.OutputResolutions[0])
|
||||
{
|
||||
propertyLogic.SaveAllCollection();
|
||||
if (!_Configuration.LoadOrCreateThenSaveImageFacesResults.Value && !_Configuration.LoadOrCreateThenSaveDirectoryDistanceResults.Value && !_Configuration.LoadOrCreateThenSaveDistanceResults.Value)
|
||||
break;
|
||||
if (_Exceptions.Count == 0)
|
||||
@ -729,8 +733,9 @@ public class DlibDotNet
|
||||
private void Search(Property.Models.Configuration configuration, string[] juliePhares, bool reverse, Model model, PredictorModel predictorModel, string argZero, Person[] people)
|
||||
{
|
||||
PropertyLogic propertyLogic = GetPropertyLogic();
|
||||
Dictionary<string, List<Person>> peopleCollection = A2_People.Convert(people);
|
||||
List<PropertyHolder[]> propertyHolderCollections = Property.Models.Stateless.A_Property.Get(configuration, reverse, model.ToString(), predictorModel.ToString(), propertyLogic);
|
||||
FullDoWork(configuration, juliePhares, model, predictorModel, argZero, people, propertyLogic, propertyHolderCollections);
|
||||
FullDoWork(configuration, juliePhares, model, predictorModel, argZero, peopleCollection, propertyLogic, propertyHolderCollections);
|
||||
}
|
||||
|
||||
internal void RenameQueue(Property.Models.Configuration configuration, Model model, PredictorModel predictorModel) => _Rename.RenameQueue(configuration, model, predictorModel);
|
||||
|
Reference in New Issue
Block a user