Added FileHolder

This commit is contained in:
2022-08-08 19:23:48 -07:00
parent daf5f428b9
commit 3aeab88384
15 changed files with 448 additions and 288 deletions

View File

@ -221,20 +221,20 @@ public class UnitTestFace
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);
Property.Models.FileHolder fileHolder = new(Path.Combine(sourceDirectory, sourceFileName));
string relativePath = Property.Models.Stateless.IPath.GetRelativePath(fileHolder.FullName, length);
sourceDirectory = Path.Combine(aPropertySingletonDirectory, sourceDirectoryName);
propertyHolder = new(g, sourceDirectory, sourceDirectoryFile, relativePath, r, fileInfo, property, false, false, null, null);
Assert.IsNotNull(propertyHolder.ImageFileInfo);
propertyHolder = new(g, sourceDirectory, sourceDirectoryFile, relativePath, r, fileHolder, property, false, false, null, null);
Assert.IsNotNull(propertyHolder.ImageFileHolder);
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);
Property.Models.FileHolder resizedFileHolder = new(Path.Combine(resize.AngleBracketCollection[0].Replace("<>", "()"), Path.GetFileName(propertyHolder.ImageFileHolder.FullName)));
propertyHolder.SetResizedFileHolder(resizedFileHolder);
resize.SaveResizedSubfile(outputResolution, subFileTuples, propertyHolder, original, property, imageResizeKeyValuePairs);
resizedFileInfo.Refresh();
Assert.IsNotNull(propertyHolder.ResizedFileInfo);
Image? image = FaceRecognition.LoadImageFile(propertyHolder.ResizedFileInfo.FullName);
propertyHolder.SetResizedFileHolder(Property.Models.FileHolder.Refresh(resizedFileHolder));
Assert.IsNotNull(propertyHolder.ResizedFileHolder);
Image? image = FaceRecognition.LoadImageFile(propertyHolder.ResizedFileHolder.FullName);
Assert.IsNotNull(image);
FaceRecognition faceRecognition = FaceRecognition.Create(modelParameter);
List<Location> locations = faceRecognition.FaceLocations(model, image, _Configuration.NumberOfTimesToUpsample.Value, sortByPixelPercentage: true);