Drag Drop Form and Copy Not Mapped Faces

This commit is contained in:
2022-10-23 00:50:36 -07:00
parent c6757ad332
commit cfeeb0eb95
18 changed files with 175 additions and 81 deletions

View File

@ -145,10 +145,10 @@ public class UnitTestFace
Assert.IsTrue(ToleranceAfterFactor == 600);
double valueA = 0.00001d;
int checkA = (int)(Math.Round(valueA, _Configuration.LocationDigits) * _Configuration.LocationFactor);
Assert.IsTrue(checkA == 10);
Assert.IsTrue(checkA == 0);
double valueB = 0.01d;
int checkB = (int)(Math.Round(valueB, _Configuration.LocationDigits) * _Configuration.LocationFactor);
Assert.IsTrue(checkB == 10000);
Assert.IsTrue(checkB == 100);
Assert.IsTrue(checkB > checkA);
int checkC = (int)(_Configuration.FaceDistanceTolerance * DistanceFactor);
Assert.IsTrue(checkC == ToleranceAfterFactor);
@ -185,7 +185,6 @@ public class UnitTestFace
string outputResolution = _Configuration.OutputResolutions[0];
Property.Models.A_Property propertyLogic = GetPropertyLogic(reverse);
string sourceDirectory = Path.Combine(_PropertyConfiguration.RootDirectory, sourceDirectoryName);
(Model model, PredictorModel predictorModel, ModelParameter modelParameter) = GetModel(_Configuration);
_Logger.Information(_Configuration.ModelDirectory);
aResultsFullGroupDirectory = Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(
_PropertyConfiguration, nameof(Property.Models.A_Property), outputResolution, includeResizeGroup: false, includeModel: false, includePredictorModel: false);
@ -240,6 +239,7 @@ public class UnitTestFace
resize.SaveResizedSubfile(outputResolution, cResultsFullGroupDirectory, subFileTuples, item, original, imageResizeKeyValuePairs);
Image image = FaceRecognition.LoadImageFile(item.ResizedFileHolder.FullName);
Assert.IsNotNull(image);
(Model model, PredictorModel predictorModel, ModelParameter modelParameter) = GetModel(_Configuration);
FaceRecognition faceRecognition = new(_Configuration.NumberOfTimesToUpsample, _Configuration.NumberOfJitters, predictorModel, model, modelParameter);
List<(Location Location, FaceRecognitionDotNet.FaceEncoding? FaceEncoding, Dictionary<FacePart, FacePoint[]>? FaceParts)> collection;
collection = faceRecognition.GetCollection(image, includeFaceEncoding: true, includeFaceParts: true);