Force Single Image => Sorting
This commit is contained in:
@ -42,79 +42,83 @@ public class MapLogicSupport : Shared.Models.Methods.IMapLogicSupport
|
||||
List<SortingContainer> results = new();
|
||||
SortingContainer sortingContainer;
|
||||
Sorting[] collection = Shared.Models.Stateless.Methods.ISorting.Sort(sortingCollection);
|
||||
double a;
|
||||
double b;
|
||||
double c;
|
||||
double d;
|
||||
double faceDistancePermyriad;
|
||||
double sortingDaysDeltaTolerance;
|
||||
double faceDistanceMinimumConfidence;
|
||||
double faceDistanceAreaPermilleTolerance;
|
||||
if (useFiltersCounter is null)
|
||||
{
|
||||
sortingDaysDeltaTolerance = _SortingDaysDeltaTolerance;
|
||||
faceDistancePermyriad = _FaceDistancePermyriad;
|
||||
faceDistanceAreaPermilleTolerance = _FaceDistanceAreaPermilleTolerance;
|
||||
faceDistanceMinimumConfidence = _FaceDistanceMinimumConfidence;
|
||||
a = 1f;
|
||||
b = 1f;
|
||||
c = 1f;
|
||||
d = 1f;
|
||||
}
|
||||
else if (useFiltersCounter.Value == 1)
|
||||
else if (useFiltersCounter.Value < 5)
|
||||
{
|
||||
sortingDaysDeltaTolerance = _SortingDaysDeltaTolerance * 1.5;
|
||||
faceDistancePermyriad = _FaceDistancePermyriad;
|
||||
faceDistanceAreaPermilleTolerance = _FaceDistanceAreaPermilleTolerance;
|
||||
faceDistanceMinimumConfidence = _FaceDistanceMinimumConfidence;
|
||||
a = 1.25f;
|
||||
b = 0.8f;
|
||||
c = a;
|
||||
d = b;
|
||||
}
|
||||
else if (useFiltersCounter.Value == 2)
|
||||
else if (useFiltersCounter.Value < 9)
|
||||
{
|
||||
sortingDaysDeltaTolerance = _SortingDaysDeltaTolerance;
|
||||
faceDistancePermyriad = _FaceDistancePermyriad * 1.5;
|
||||
faceDistanceAreaPermilleTolerance = _FaceDistanceAreaPermilleTolerance;
|
||||
faceDistanceMinimumConfidence = _FaceDistanceMinimumConfidence;
|
||||
a = 1.5f;
|
||||
b = 0.667f;
|
||||
c = a;
|
||||
d = b;
|
||||
}
|
||||
else if (useFiltersCounter.Value == 3)
|
||||
else if (useFiltersCounter.Value < 13)
|
||||
{
|
||||
a = 1.75f;
|
||||
b = 0.571f;
|
||||
c = a;
|
||||
d = b;
|
||||
}
|
||||
else
|
||||
{
|
||||
a = 2f;
|
||||
b = 0.5f;
|
||||
c = a;
|
||||
d = b;
|
||||
}
|
||||
if (useFiltersCounter is null)
|
||||
{
|
||||
sortingDaysDeltaTolerance = _SortingDaysDeltaTolerance;
|
||||
faceDistancePermyriad = _FaceDistancePermyriad;
|
||||
faceDistanceMinimumConfidence = _FaceDistanceMinimumConfidence;
|
||||
faceDistanceAreaPermilleTolerance = _FaceDistanceAreaPermilleTolerance;
|
||||
faceDistanceMinimumConfidence = _FaceDistanceMinimumConfidence * .5;
|
||||
}
|
||||
else if (useFiltersCounter.Value == 4)
|
||||
else if (useFiltersCounter.Value is 1 or 5 or 9 or 13)
|
||||
{
|
||||
sortingDaysDeltaTolerance = _SortingDaysDeltaTolerance * 2;
|
||||
faceDistancePermyriad = _FaceDistancePermyriad * 1.5;
|
||||
faceDistanceAreaPermilleTolerance = _FaceDistanceAreaPermilleTolerance;
|
||||
faceDistanceMinimumConfidence = _FaceDistanceMinimumConfidence * .5;
|
||||
sortingDaysDeltaTolerance = _SortingDaysDeltaTolerance * a;
|
||||
faceDistancePermyriad = _FaceDistancePermyriad * c;
|
||||
faceDistanceMinimumConfidence = _FaceDistanceMinimumConfidence * d;
|
||||
faceDistanceAreaPermilleTolerance = _FaceDistanceAreaPermilleTolerance * d;
|
||||
}
|
||||
else if (useFiltersCounter.Value == 5)
|
||||
else if (useFiltersCounter.Value is 2 or 6 or 10 or 14)
|
||||
{
|
||||
sortingDaysDeltaTolerance = _SortingDaysDeltaTolerance * 1.5;
|
||||
faceDistancePermyriad = _FaceDistancePermyriad * 2;
|
||||
faceDistanceAreaPermilleTolerance = _FaceDistanceAreaPermilleTolerance;
|
||||
faceDistanceMinimumConfidence = _FaceDistanceMinimumConfidence * .5;
|
||||
sortingDaysDeltaTolerance = _SortingDaysDeltaTolerance * c;
|
||||
faceDistancePermyriad = _FaceDistancePermyriad * a;
|
||||
faceDistanceMinimumConfidence = _FaceDistanceMinimumConfidence * d;
|
||||
faceDistanceAreaPermilleTolerance = _FaceDistanceAreaPermilleTolerance * d;
|
||||
}
|
||||
else if (useFiltersCounter.Value == 6)
|
||||
else if (useFiltersCounter.Value is 3 or 7 or 11 or 15)
|
||||
{
|
||||
sortingDaysDeltaTolerance = _SortingDaysDeltaTolerance * 1.5;
|
||||
faceDistancePermyriad = _FaceDistancePermyriad * 1.5;
|
||||
faceDistanceAreaPermilleTolerance = _FaceDistanceAreaPermilleTolerance;
|
||||
faceDistanceMinimumConfidence = _FaceDistanceMinimumConfidence * .25;
|
||||
sortingDaysDeltaTolerance = _SortingDaysDeltaTolerance * c;
|
||||
faceDistancePermyriad = _FaceDistancePermyriad * c;
|
||||
faceDistanceMinimumConfidence = _FaceDistanceMinimumConfidence * b;
|
||||
faceDistanceAreaPermilleTolerance = _FaceDistanceAreaPermilleTolerance * d;
|
||||
}
|
||||
else if (useFiltersCounter.Value == 7)
|
||||
else if (useFiltersCounter.Value is 4 or 8 or 12 or 16)
|
||||
{
|
||||
sortingDaysDeltaTolerance = _SortingDaysDeltaTolerance * 2.5;
|
||||
faceDistancePermyriad = _FaceDistancePermyriad * 2;
|
||||
faceDistanceAreaPermilleTolerance = _FaceDistanceAreaPermilleTolerance;
|
||||
faceDistanceMinimumConfidence = _FaceDistanceMinimumConfidence * .25;
|
||||
}
|
||||
else if (useFiltersCounter.Value == 8)
|
||||
{
|
||||
sortingDaysDeltaTolerance = _SortingDaysDeltaTolerance * 2;
|
||||
faceDistancePermyriad = _FaceDistancePermyriad * 2.5;
|
||||
faceDistanceAreaPermilleTolerance = _FaceDistanceAreaPermilleTolerance;
|
||||
faceDistanceMinimumConfidence = _FaceDistanceMinimumConfidence * .25;
|
||||
}
|
||||
else if (useFiltersCounter.Value == 9)
|
||||
{
|
||||
sortingDaysDeltaTolerance = _SortingDaysDeltaTolerance * 2;
|
||||
faceDistancePermyriad = _FaceDistancePermyriad * 2;
|
||||
faceDistanceAreaPermilleTolerance = _FaceDistanceAreaPermilleTolerance;
|
||||
faceDistanceMinimumConfidence = 0;
|
||||
sortingDaysDeltaTolerance = _SortingDaysDeltaTolerance * c;
|
||||
faceDistancePermyriad = _FaceDistancePermyriad * c;
|
||||
faceDistanceMinimumConfidence = _FaceDistanceMinimumConfidence * d;
|
||||
faceDistanceAreaPermilleTolerance = _FaceDistanceAreaPermilleTolerance * b;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -297,4 +301,20 @@ public class MapLogicSupport : Shared.Models.Methods.IMapLogicSupport
|
||||
}
|
||||
}
|
||||
|
||||
public static Dictionary<int, Dictionary<int, Mapping>> GetIdToNormalizedPixelPercentageToFace(Mapping[] mappingCollection)
|
||||
{
|
||||
Dictionary<int, Dictionary<int, Mapping>> results = new();
|
||||
Dictionary<int, Mapping> keyValuePairs;
|
||||
foreach (Mapping mapping in mappingCollection)
|
||||
{
|
||||
if (!results.ContainsKey(mapping.MappingFromItem.Id))
|
||||
results.Add(mapping.MappingFromItem.Id, new());
|
||||
keyValuePairs = results[mapping.MappingFromItem.Id];
|
||||
if (keyValuePairs.ContainsKey(mapping.MappingFromLocation.NormalizedPixelPercentage))
|
||||
throw new NotSupportedException();
|
||||
keyValuePairs.Add(mapping.MappingFromLocation.NormalizedPixelPercentage, mapping);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user