Commit 7790361b95a69c5b8ab641b61633528f53de11ab

Authored by Brendan K
1 parent efd7e096

Updated eval code

Showing 1 changed file with 6 additions and 6 deletions
openbr/core/eval.cpp
... ... @@ -1251,7 +1251,7 @@ void EvalEER(const QString &predictedXML, QString gt_property, QString distribut
1251 1251 const TemplateList templateList(TemplateList::fromGallery(predictedXML));
1252 1252  
1253 1253 QHash<QString, int> gtLabels;
1254   - QHash<QString, QList<float> > scores;
  1254 + QHash<QString, float > scores;
1255 1255 for (int i=0; i<templateList.size(); i++) {
1256 1256 if (!templateList[i].file.contains(distribution_property) || !templateList[i].file.contains(gt_property))
1257 1257 continue;
... ... @@ -1259,7 +1259,7 @@ void EvalEER(const QString &amp;predictedXML, QString gt_property, QString distribut
1259 1259 const int gtLabel = templateList[i].file.get<int>(gt_property);
1260 1260 if (gtLabel == 1)
1261 1261 classOneTemplateCount++;
1262   - const QList<float> templateScores = templateList[i].file.getList<float>(distribution_property);
  1262 + const float templateScores = templateList[i].file.get<float>(distribution_property);
1263 1263 gtLabels[templateKey] = gtLabel;
1264 1264 scores[templateKey] = templateScores;
1265 1265 }
... ... @@ -1278,13 +1278,13 @@ void EvalEER(const QString &amp;predictedXML, QString gt_property, QString distribut
1278 1278 foreach(const QString &key, scores.keys()) {
1279 1279 int gtLabel = gtLabels[key];
1280 1280 //> thresNorm = class 0 (spoof) : < thresNorm = class 1 (genuine)
1281   - if (scores[key][0] >= thresNorm && gtLabel == 0)
  1281 + if (scores[key] >= thresNorm && gtLabel == 0)
1282 1282 continue;
1283   - else if (scores[key][0] < thresNorm && gtLabel == 1)
  1283 + else if (scores[key] < thresNorm && gtLabel == 1)
1284 1284 continue;
1285   - else if (scores[key][0] >= thresNorm && gtLabel == 1)
  1285 + else if (scores[key] >= thresNorm && gtLabel == 1)
1286 1286 FR +=1;
1287   - else if (scores[key][0] < thresNorm && gtLabel == 0)
  1287 + else if (scores[key] < thresNorm && gtLabel == 0)
1288 1288 FA +=1;
1289 1289 }
1290 1290 const float FAR = FA / float(numTemplates - classOneTemplateCount);
... ...