Commit 597d765b35e4b6fe81ceaa0362f4eab6993f46b9
1 parent
bc389df0
only plot TAR at FAR=1e-4
Showing
2 changed files
with
15 additions
and
16 deletions
openbr/core/plot.cpp
| ... | ... | @@ -213,22 +213,8 @@ bool Plot(const QStringList &files, const File &destination, bool show) |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | // optional plot metadata and accuracy tables |
| 216 | - if (destination.getBool("metadata", true)) { | |
| 217 | - p.file.write("\n# Write metadata table\n"); | |
| 218 | - p.file.write(qPrintable(QString("plotMetadata(metadata=Metadata, title=\"%1 - %2\")\n").arg(PRODUCT_NAME, PRODUCT_VERSION))); | |
| 219 | - | |
| 220 | - if (!destination.getBool("csv")) p.file.write("plot.new()\n"); | |
| 221 | - QString table = "plotTable(tableData=%1, name=%2, labels=%3)\n"; | |
| 222 | - p.file.write(qPrintable(table.arg("TF", "\"Table of True Accept Rates at various False Accept Rates\"", | |
| 223 | - "c(\"FAR = 1e-06\", \"FAR = 1e-05\", \"FAR = 1e-04\", \"FAR = 1e-03\", \"FAR = 1e-02\", \"FAR = 1e-01\")"))); | |
| 224 | - p.file.write(qPrintable(table.arg("FT", "\"Table of False Accept Rates at various True Accept Rates\"", | |
| 225 | - "c(\"TAR = 0.40\", \"TAR = 0.50\", \"TAR = 0.65\", \"TAR = 0.75\", \"TAR = 0.85\", \"TAR = 0.95\")"))); | |
| 226 | - p.file.write(qPrintable(table.arg("CT", "\"Table of retrieval rate at various ranks\"", | |
| 227 | - "c(\"Rank 1\", \"Rank 5\", \"Rank 10\", \"Rank 20\", \"Rank 50\", \"Rank 100\")"))); | |
| 228 | - p.file.write(qPrintable(table.arg("TS", "\"Template Size by Algorithm\"", | |
| 229 | - "c(\"Template Size (bytes):\")"))); | |
| 230 | - p.file.write("\n"); | |
| 231 | - } | |
| 216 | + if (destination.getBool("metadata", true)) | |
| 217 | + p.file.write("plotTAR(tableData=TF)\n"); | |
| 232 | 218 | |
| 233 | 219 | // Write plots |
| 234 | 220 | QString plot = "plot <- plotLine(lineData=%1, options=list(%2), flipY=%3)\nplot\n"; | ... | ... |
share/openbr/plotting/plot_utils.R
| ... | ... | @@ -62,6 +62,19 @@ plotTable <- function(tableData=NULL, name=NULL, labels=NULL) { |
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | +plotTAR <- function(tableData=NULL) { | |
| 66 | + if (nrow(tableData) == 0) return() | |
| 67 | + major <- majorHeader | |
| 68 | + minor <- if(minorHeader == "") majorHeader else minorHeader | |
| 69 | + tableData <- tableData[grep(1e-4,tableData$X),] | |
| 70 | + mat <- matrix(tableData$Y, nrow=length(tableData[,major][!duplicated(tableData[,major])]), ncol=length(tableData[,minor][!duplicated(tableData[,minor])]), byrow=FALSE) | |
| 71 | + colnames(mat) <- tableData[,minor][!duplicated(tableData[,minor])] | |
| 72 | + rownames(mat) <- tableData[,major][!duplicated(tableData[,major])] | |
| 73 | + table <- as.table(mat) | |
| 74 | + print(textplot(table)) | |
| 75 | + print(title("True Accept Rate at FAR=1e-4")) | |
| 76 | +} | |
| 77 | + | |
| 65 | 78 | plotLandmarkTables <- function(tableData=NULL) { |
| 66 | 79 | if (majorSize > 1) { |
| 67 | 80 | var <- majorHeader | ... | ... |