Updated results and report

This commit is contained in:
Simon Gruber
2024-01-08 16:45:35 +01:00
parent 6c554e444f
commit 74619876c2
1130 changed files with 370 additions and 364 deletions
@@ -47,7 +47,6 @@ public readonly struct ProcessorStat : IDistanceComparer<IEnumerable<string>>
) / reference.Count;
Words = GetDistanceInfos(reference, hypothesis).ToArray();
// Words = reference.Select(r => GetDistanceInfo(r, hypothesis)).ToArray();
}
@@ -66,8 +65,7 @@ public readonly struct ProcessorStat : IDistanceComparer<IEnumerable<string>>
foreach (var reference in referenceCollection)
{
var tResults = hypothesisCollection
.Select(hypothesis => new DistanceComparer<string>(reference, hypothesis))
.Cast<IDistanceComparer<string>>()
.Select(hypothesis => (IDistanceComparer<string>)new DistanceComparer<string>(reference, hypothesis))
.ToList();
results.AddRange(tResults);
+1 -2
View File
@@ -28,13 +28,12 @@ internal static class Program
var result = v.Average(out var deviation);
return (result, deviation);
})
// .AddComparison("Processing summary (Cumulative)", v => v.Sum())
.AddComparison("Processing summary (Median)", v =>
{
var result = v.Median(out var deviation);
return (result, deviation);
})
// .AddProcessorStats("Processor Stats")
.AddProcessorStats("Processor Stats")
.AddImageStatsFull("Scan Results");
Console.WriteLine($"Saved report to '{path}'");
@@ -3,7 +3,7 @@
"ReportGenerator": {
"commandName": "Project",
"commandLineArgs": "\"img\" \"results\"",
"workingDirectory": "D:\\git\\BA\\Examples\\testdata"
"workingDirectory": "D:\\git\\ba_ocr\\Implementation\\testdata"
}
}
}
@@ -109,6 +109,7 @@ public class ReportGenerator : IDisposable
table.AppendHeader(stat
.Reference
.Prepend("Image")
.Prepend("Perfect matches")
.Prepend("CER (avg)")
.Prepend("WER")
.Prepend("Elapsed")
@@ -126,6 +127,7 @@ public class ReportGenerator : IDisposable
table.AppendRow(processor.Words
.Select(s => s.ToString() ?? string.Empty)
.Prepend(Document.FormatImage(imgPath, new Bounds(0, 150)))
.Prepend($"{processor.Words.Count(w => w.Distance == 0)} / {processor.Words.Count}")
.Prepend(processor.Words.Average(s => s.Distance).ToString("F2"))
.Prepend($"{processor.Distance * 100:F1}%")
.Prepend($"{processor.ProcessingTime * 1000:F1}ms")
@@ -198,7 +200,6 @@ public class ReportGenerator : IDisposable
return this;
}
private void AppendComparison(
(string name, string unit)? valueInfo,
IEnumerable<(string, double, double)> values