Mass push
This commit is contained in:
@ -50,6 +50,7 @@ public class Configuration
|
||||
[Display(Name = "Person Birthday First Year"), Required] public int? PersonBirthdayFirstYear { get; set; }
|
||||
[Display(Name = "Person Birthday Format"), Required] public string PersonBirthdayFormat { get; set; }
|
||||
[Display(Name = "PersonKey Format"), Required] public string PersonKeyFormat { get; set; }
|
||||
[Display(Name = "Photo-Prism Directory"), Required] public string PhotoPrismDirectory { 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; }
|
||||
@ -58,10 +59,10 @@ public class Configuration
|
||||
[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 = "Sorting Days Delta Tolerance"), Required] public int[] RangeDaysDeltaTolerance { get; set; }
|
||||
[Display(Name = "Face Distance Tolerance"), Required] public double[] RangeDistanceTolerance { get; set; }
|
||||
[Display(Name = "Face Area Permille Tolerance"), Required] public int[] RangeFaceAreaPermilleTolerance { get; set; }
|
||||
[Display(Name = "Location Minimum Confidence"), Required] public double[] RangeFaceConfidence { get; set; }
|
||||
[Display(Name = "Face Distance Tolerance"), Required] public double[] RangeDistanceTolerance { get; set; }
|
||||
[Display(Name = "Retry Images Without a Face"), Required] public bool? RetryImagesWithoutAFace { get; set; }
|
||||
[Display(Name = "Retry Images Without a Face"), Required] public bool? RetryImagesWithoutAFaceLocation { get; set; }
|
||||
[Display(Name = "Reverse"), Required] public bool? Reverse { get; set; }
|
||||
[Display(Name = "Save Face Distances"), Required] public string[] SaveFaceDistancesForOutputResolutions { get; set; }
|
||||
[Display(Name = "Save Face Landmark For Output Resolutions"), Required] public string[] SaveFaceLandmarkForOutputResolutions { get; set; }
|
||||
@ -159,6 +160,8 @@ public class Configuration
|
||||
throw new NullReferenceException(nameof(configuration.PersonBirthdayFormat));
|
||||
if (configuration.PersonKeyFormat is null)
|
||||
throw new NullReferenceException(nameof(configuration.PersonKeyFormat));
|
||||
if (configuration.PhotoPrismDirectory is null)
|
||||
throw new NullReferenceException(nameof(configuration.PhotoPrismDirectory));
|
||||
if (configuration.PropertiesChangedForDistance is null)
|
||||
throw new NullReferenceException(nameof(configuration.PropertiesChangedForDistance));
|
||||
if (configuration.PropertiesChangedForFaces is null)
|
||||
@ -177,8 +180,8 @@ public class Configuration
|
||||
throw new NullReferenceException(nameof(configuration.RangeFaceConfidence));
|
||||
if (configuration.RangeDistanceTolerance is null || configuration.RangeDistanceTolerance.Length != 3)
|
||||
throw new NullReferenceException(nameof(configuration.RangeDistanceTolerance));
|
||||
if (configuration.RetryImagesWithoutAFace is null)
|
||||
throw new NullReferenceException(nameof(configuration.RetryImagesWithoutAFace));
|
||||
if (configuration.RetryImagesWithoutAFaceLocation is null)
|
||||
throw new NullReferenceException(nameof(configuration.RetryImagesWithoutAFaceLocation));
|
||||
if (configuration.Reverse is null)
|
||||
throw new NullReferenceException(nameof(configuration.Reverse));
|
||||
configuration.SaveFaceDistancesForOutputResolutions ??= Array.Empty<string>();
|
||||
@ -235,8 +238,6 @@ public class Configuration
|
||||
configuration.MixedYearRelativePaths,
|
||||
configuration.ModelDirectory,
|
||||
configuration.ModelName,
|
||||
configuration.NumberOfJitters.Value,
|
||||
configuration.NumberOfTimesToUpsample.Value,
|
||||
configuration.OutputExtension,
|
||||
configuration.OutputQuality.Value,
|
||||
configuration.OutputResolutions,
|
||||
@ -246,6 +247,7 @@ public class Configuration
|
||||
configuration.PersonBirthdayFirstYear.Value,
|
||||
configuration.PersonBirthdayFormat,
|
||||
configuration.PersonKeyFormat,
|
||||
configuration.PhotoPrismDirectory,
|
||||
configuration.PredictorModelName,
|
||||
configuration.PropertiesChangedForDistance.Value,
|
||||
configuration.PropertiesChangedForFaces.Value,
|
||||
@ -256,7 +258,7 @@ public class Configuration
|
||||
configuration.RangeFaceAreaPermilleTolerance,
|
||||
configuration.RangeFaceConfidence,
|
||||
configuration.RangeDistanceTolerance,
|
||||
configuration.RetryImagesWithoutAFace.Value,
|
||||
configuration.RetryImagesWithoutAFaceLocation.Value,
|
||||
configuration.Reverse.Value,
|
||||
configuration.SaveFaceDistancesForOutputResolutions,
|
||||
configuration.SaveFaceLandmarkForOutputResolutions,
|
||||
@ -289,9 +291,7 @@ public class Configuration
|
||||
configuration = configurationSection.Get<Configuration>();
|
||||
}
|
||||
result = Get(configuration);
|
||||
if (configuration is null)
|
||||
throw new NullReferenceException(nameof(configuration));
|
||||
result.SetAndUpdate(propertyConfiguration, configuration.NumberOfJitters, configuration.NumberOfTimesToUpsample, configuration.ModelName, configuration.PredictorModelName);
|
||||
result.SetAndUpdate(propertyConfiguration, configuration?.NumberOfJitters, configuration?.NumberOfTimesToUpsample, configuration?.ModelName, configuration?.PredictorModelName);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -38,8 +38,6 @@ public class Configuration
|
||||
public string[] MixedYearRelativePaths { init; get; }
|
||||
public string ModelDirectory { init; get; }
|
||||
public string ModelName { init; get; }
|
||||
public int NumberOfJitters { init; get; }
|
||||
public int NumberOfTimesToUpsample { init; get; }
|
||||
public string OutputExtension { init; get; }
|
||||
public int OutputQuality { init; get; }
|
||||
public string[] OutputResolutions { init; get; }
|
||||
@ -49,6 +47,7 @@ public class Configuration
|
||||
public int PersonBirthdayFirstYear { init; get; }
|
||||
public string PersonBirthdayFormat { init; get; }
|
||||
public string PersonKeyFormat { init; get; }
|
||||
public string PhotoPrismDirectory { init; get; }
|
||||
public string PredictorModelName { init; get; }
|
||||
public bool PropertiesChangedForDistance { init; get; }
|
||||
public bool PropertiesChangedForFaces { init; get; }
|
||||
@ -59,7 +58,7 @@ public class Configuration
|
||||
public int[] RangeFaceAreaPermilleTolerance { init; get; }
|
||||
public double[] RangeFaceConfidence { init; get; }
|
||||
public double[] RangeDistanceTolerance { init; get; }
|
||||
public bool RetryImagesWithoutAFace { init; get; }
|
||||
public bool RetryImagesWithoutAFaceLocation { init; get; }
|
||||
public bool Reverse { init; get; }
|
||||
public string[] SaveFaceDistancesForOutputResolutions { init; get; }
|
||||
public string[] SaveFaceLandmarkForOutputResolutions { init; get; }
|
||||
@ -107,8 +106,6 @@ public class Configuration
|
||||
string[] mixedYearRelativePaths,
|
||||
string modelDirectory,
|
||||
string modelName,
|
||||
int numberOfJitters,
|
||||
int numberOfTimesToUpsample,
|
||||
string outputExtension,
|
||||
int outputQuality,
|
||||
string[] outputResolutions,
|
||||
@ -118,6 +115,7 @@ public class Configuration
|
||||
int personBirthdayFirstYear,
|
||||
string personBirthdayFormat,
|
||||
string personKeyFormat,
|
||||
string photoPrismDirectory,
|
||||
string predictorModelName,
|
||||
bool propertiesChangedForDistance,
|
||||
bool propertiesChangedForFaces,
|
||||
@ -128,7 +126,7 @@ public class Configuration
|
||||
int[] rangeFaceAreaPermilleTolerance,
|
||||
double[] rangeFaceConfidence,
|
||||
double[] rangeDistanceTolerance,
|
||||
bool retryImagesWithoutAFace,
|
||||
bool retryImagesWithoutAFaceLocation,
|
||||
bool reverse,
|
||||
string[] saveFaceDistancesForOutputResolutions,
|
||||
string[] saveFaceLandmarkForOutputResolutions,
|
||||
@ -175,8 +173,6 @@ public class Configuration
|
||||
MixedYearRelativePaths = mixedYearRelativePaths;
|
||||
ModelDirectory = modelDirectory;
|
||||
ModelName = modelName;
|
||||
NumberOfJitters = numberOfJitters;
|
||||
NumberOfTimesToUpsample = numberOfTimesToUpsample;
|
||||
OutputExtension = outputExtension;
|
||||
OutputQuality = outputQuality;
|
||||
OutputResolutions = outputResolutions;
|
||||
@ -186,6 +182,7 @@ public class Configuration
|
||||
PersonBirthdayFirstYear = personBirthdayFirstYear;
|
||||
PersonBirthdayFormat = personBirthdayFormat;
|
||||
PersonKeyFormat = personKeyFormat;
|
||||
PhotoPrismDirectory = photoPrismDirectory;
|
||||
PredictorModelName = predictorModelName;
|
||||
PropertiesChangedForDistance = propertiesChangedForDistance;
|
||||
PropertiesChangedForFaces = propertiesChangedForFaces;
|
||||
@ -196,7 +193,7 @@ public class Configuration
|
||||
RangeFaceAreaPermilleTolerance = rangeFaceAreaPermilleTolerance;
|
||||
RangeFaceConfidence = rangeFaceConfidence;
|
||||
RangeDistanceTolerance = rangeDistanceTolerance;
|
||||
RetryImagesWithoutAFace = retryImagesWithoutAFace;
|
||||
RetryImagesWithoutAFaceLocation = retryImagesWithoutAFaceLocation;
|
||||
Reverse = reverse;
|
||||
SaveFaceDistancesForOutputResolutions = saveFaceDistancesForOutputResolutions;
|
||||
SaveFaceLandmarkForOutputResolutions = saveFaceLandmarkForOutputResolutions;
|
||||
|
@ -145,7 +145,6 @@ public class G_Index : Shared.Models.Properties.IIndex, IIndex
|
||||
Dictionary<string, List<Tuple<string, Shared.Models.Property>>> filePropertiesKeyValuePairs = new();
|
||||
FileInfo fileInfo;
|
||||
G_Index indexInfo;
|
||||
string parentCheck;
|
||||
List<int> indices = new();
|
||||
Dictionary<int, G_Index> valuePairs;
|
||||
List<string> directoryInfoCollection;
|
||||
@ -170,14 +169,6 @@ public class G_Index : Shared.Models.Properties.IIndex, IIndex
|
||||
foreach (Tuple<string, Shared.Models.Property> tuple in tuples.Value)
|
||||
{
|
||||
fileInfo = new FileInfo(Path.Combine(directoryInfoCollection[0].Replace("<>", "{}"), string.Concat(Path.GetFileNameWithoutExtension(tuple.Item1), ".json")));
|
||||
if (!fileInfo.FullName.Contains(configuration.ResultAllInOne) && !fileInfo.Exists)
|
||||
{
|
||||
if (fileInfo.Directory?.Parent is null)
|
||||
throw new Exception();
|
||||
parentCheck = Path.Combine(fileInfo.Directory.Parent.FullName, fileInfo.Name);
|
||||
if (File.Exists(parentCheck))
|
||||
File.Delete(parentCheck);
|
||||
}
|
||||
if (_Configuration.PropertiesChangedForIndex)
|
||||
indexInfo = null;
|
||||
else if (!fileInfo.Exists)
|
||||
|
Reference in New Issue
Block a user