Commit 8c6e8f901bfa9fb8d149cb466749f1dacf6a3069
1 parent
75770527
handle exponent edge cases
Showing
1 changed file
with
3 additions
and
4 deletions
openbr/core/eval.cpp
| @@ -232,7 +232,6 @@ float Evaluate(const Mat &simmat, const Mat &mask, const File &csv, const QStrin | @@ -232,7 +232,6 @@ float Evaluate(const Mat &simmat, const Mat &mask, const File &csv, const QStrin | ||
| 232 | if (numNaNs > 0) qWarning("Encountered %d NaN scores!", numNaNs); | 232 | if (numNaNs > 0) qWarning("Encountered %d NaN scores!", numNaNs); |
| 233 | if (genuineCount == 0) qFatal("No genuine scores!"); | 233 | if (genuineCount == 0) qFatal("No genuine scores!"); |
| 234 | if (impostorCount == 0) qFatal("No impostor scores!"); | 234 | if (impostorCount == 0) qFatal("No impostor scores!"); |
| 235 | - if (totalImpostorSearches == 0) totalImpostorSearches = 10; | ||
| 236 | 235 | ||
| 237 | // Sort comparisons by simmat_val (score) | 236 | // Sort comparisons by simmat_val (score) |
| 238 | std::stable_sort(comparisons.begin(), comparisons.end()); | 237 | std::stable_sort(comparisons.begin(), comparisons.end()); |
| @@ -347,9 +346,9 @@ float Evaluate(const Mat &simmat, const Mat &mask, const File &csv, const QStrin | @@ -347,9 +346,9 @@ float Evaluate(const Mat &simmat, const Mat &mask, const File &csv, const QStrin | ||
| 347 | } | 346 | } |
| 348 | 347 | ||
| 349 | // Write Detection Error Tradeoff (DET), PRE, REC, Identification Error Tradeoff (IET) | 348 | // Write Detection Error Tradeoff (DET), PRE, REC, Identification Error Tradeoff (IET) |
| 350 | - float expFAR = csv.get<float>("FAR", ceil(log10(impostorCount))); | ||
| 351 | - float expFRR = csv.get<float>("FRR", ceil(log10(genuineCount))); | ||
| 352 | - float expFPIR = csv.get<float>("FPIR", ceil(log10(totalImpostorSearches))); | 349 | + float expFAR = csv.get<float>("FAR", std::max(ceil(log10(impostorCount)), 1.0)); |
| 350 | + float expFRR = csv.get<float>("FRR", std::max(ceil(log10(genuineCount)), 1.0)); | ||
| 351 | + float expFPIR = csv.get<float>("FPIR", std::max(ceil(log10(totalImpostorSearches)), 1.0)); | ||
| 353 | 352 | ||
| 354 | float FARstep = expFAR / (float)(Max_Points - 1); | 353 | float FARstep = expFAR / (float)(Max_Points - 1); |
| 355 | float FRRstep = expFRR / (float)(Max_Points - 1); | 354 | float FRRstep = expFRR / (float)(Max_Points - 1); |