Commit fb4c843f79d09c00f4aef99b4ef1dd86bd8b55b1

Authored by Ben Klein
Committed by Ben Klein
1 parent 56197f41

Template size table

openbr/core/eval.cpp
... ... @@ -310,6 +310,16 @@ float Evaluate(const Mat &simmat, const Mat &mask, const QString &csv, const QSt
310 310 lines.append(qPrintable(QString("BC,0.001,%1").arg(QString::number(getTAR(operatingPoints, 0.001), 'f', 3))));
311 311 lines.append(qPrintable(QString("BC,0.01,%1").arg(QString::number(result = getTAR(operatingPoints, 0.01), 'f', 3))));
312 312  
  313 + // Attempt to read template size from enrolled gallery and write to output CSV
  314 + size_t maxSize(0);
  315 + if (target.endsWith(".gal")) {
  316 + foreach (const Template &t, TemplateList::fromGallery(target)) {
  317 + maxSize = max(maxSize, t.bytes());
  318 + }
  319 + }
  320 +
  321 + lines.append(QString("TS,,%1").arg(QString::number(maxSize)));
  322 +
313 323 // Write SD & KDE
314 324 points = qMin(qMin(Max_Points, genuines.size()), impostors.size());
315 325 QList<double> sampledGenuineScores; sampledGenuineScores.reserve(points);
... ... @@ -337,6 +347,7 @@ float Evaluate(const Mat &amp;simmat, const Mat &amp;mask, const QString &amp;csv, const QSt
337 347 }
338 348  
339 349 QtUtils::writeFile(csv, lines);
  350 + if (maxSize > 0) qDebug("Template Size: %i bytes", (int)maxSize);
340 351 qDebug("TAR @ FAR = 0.01: %.3f",getTAR(operatingPoints, 0.01));
341 352 qDebug("TAR @ FAR = 0.001: %.3f",getTAR(operatingPoints, 0.001));
342 353 qDebug("TAR @ FAR = 0.0001: %.3f",getTAR(operatingPoints, 0.0001));
... ...
openbr/core/plot.cpp
... ... @@ -157,6 +157,7 @@ struct RPlot
157 157 "FT <- data[grep(\"FT\",data$Plot),-c(1)]\n"
158 158 "CT <- data[grep(\"CT\",data$Plot),-c(1)]\n"
159 159 "BC <- data[grep(\"BC\",data$Plot),-c(1)]\n"
  160 + "TS <- data[grep(\"TS\",data$Plot),-c(1)]\n"
160 161 "CMC <- data[grep(\"CMC\",data$Plot),-c(1)]\n"
161 162 "FAR$Error <- \"FAR\"\n"
162 163 "FRR$Error <- \"FRR\"\n"
... ... @@ -173,6 +174,7 @@ struct RPlot
173 174 "FT$Y <- as.numeric(as.character(FT$Y))\n"
174 175 "CT$Y <- as.numeric(as.character(CT$Y))\n"
175 176 "BC$Y <- as.numeric(as.character(BC$Y))\n"
  177 + "TS$Y <- as.character(TS$Y)\n"
176 178 "CMC$Y <- as.numeric(as.character(CMC$Y))\n"
177 179 "\n"
178 180 "# Code to format FAR values\n"
... ... @@ -191,7 +193,13 @@ struct RPlot
191 193 "mat <- matrix(CT$Y,nrow=6,ncol=length(algs),byrow=FALSE)\n"
192 194 "colnames(mat) <- algs \n"
193 195 "rownames(mat) <- c(\" Rank 1\", \"Rank 5\", \"Rank 10\", \"Rank 20\", \"Rank 50\", \"Rank 100\")\n"
194   - "CMCtable <- as.table(mat)\n").arg(major.header)));
  196 + "CMCtable <- as.table(mat)\n"
  197 + "\n"
  198 + "# Code to format Template Size Table\n"
  199 + "mat <- matrix(TS$Y,nrow=1,ncol=length(algs),byrow=FALSE)\n"
  200 + "colnames(mat) <- algs\n"
  201 + "rownames(mat) <- c(\"Template Size (bytes):\")\n"
  202 + "TStable <- as.table(mat)\n").arg(major.header)));
195 203  
196 204 // Open output device
197 205 file.write(qPrintable(QString("\n"
... ... @@ -222,7 +230,9 @@ struct RPlot
222 230 "print(textplot(FTtable))\n"
223 231 "print(title(\"Table of True Accept Rates at various False Accept Rates\"))\n"
224 232 "print(textplot(CMCtable))\n"
225   - "print(title(\"Table of retrieval rate at various ranks\"))\n";
  233 + "print(title(\"Table of retrieval rate at various ranks\"))\n"
  234 + "print(textplot(TStable, cex=1.15))\n"
  235 + "print(title(\"Template Size by Algorithm\"))\n";
226 236 file.write(qPrintable(textplot.arg(PRODUCT_NAME, PRODUCT_VERSION)));
227 237 }
228 238  
... ...