Commit 33f7ed2818d22282f0cbc114033c4a50e6299375

Authored by bklare
2 parents 5b636fb1 c3bae54b

Merge branch 'master' of https://github.com/biometrics/openbr

openbr/plugins/classification/caffe.cpp
@@ -45,6 +45,7 @@ private: @@ -45,6 +45,7 @@ private:
45 45
46 CaffeNet *net = new CaffeNet(model, caffe::TEST); 46 CaffeNet *net = new CaffeNet(model, caffe::TEST);
47 net->CopyTrainedLayersFrom(weights.toStdString()); 47 net->CopyTrainedLayersFrom(weights.toStdString());
  48 + FLAGS_minloglevel = google::ERROR; // Disable Caffe's verbose output after loading the first model
48 return net; 49 return net;
49 } 50 }
50 }; 51 };
@@ -104,7 +105,7 @@ protected: @@ -104,7 +105,7 @@ protected:
104 105
105 int dimFeatures = output->count() / dataLayer->batch_size(); 106 int dimFeatures = output->count() / dataLayer->batch_size();
106 for (int n = 0; n < dataLayer->batch_size(); n++) 107 for (int n = 0; n < dataLayer->batch_size(); n++)
107 - dst += Mat(1, dimFeatures, CV_32FC1, output->mutable_cpu_data() + output->offset(n)); 108 + dst += Mat(1, dimFeatures, CV_32FC1, output->mutable_cpu_data() + output->offset(n)).clone();
108 109
109 caffeResource.release(net); 110 caffeResource.release(net);
110 } 111 }
openbr/plugins/gallery/lmdb.cpp
@@ -119,7 +119,7 @@ class lmdbGallery : public Gallery @@ -119,7 +119,7 @@ class lmdbGallery : public Gallery
119 119
120 120
121 if (!base->observedLabels.contains(label_str) ) 121 if (!base->observedLabels.contains(label_str) )
122 - base->observedLabels[label_str] = base->observedLabels.size(); 122 + base->observedLabels.insert(label_str, base->observedLabels.size());
123 123
124 datum.set_label(base->observedLabels[label_str]); 124 datum.set_label(base->observedLabels[label_str]);
125 125
share/openbr/plotting/plot_utils.R
@@ -9,7 +9,13 @@ library(&quot;grid&quot;) @@ -9,7 +9,13 @@ library(&quot;grid&quot;)
9 9
10 # Code to format FAR values 10 # Code to format FAR values
11 far_names <- list('0.001'="FAR = 0.1%", '0.01'="FAR = 1%") 11 far_names <- list('0.001'="FAR = 0.1%", '0.01'="FAR = 1%")
12 -far_labeller <- function(variable,value) { return(far_names[as.character(value)]) } 12 +far_labeller <- function(variable,value) {
  13 + if (as.character(value) %in% names(far_names)) {
  14 + return(far_names[as.character(value)])
  15 + } else {
  16 + return(as.character(value))
  17 + }
  18 +}
13 19
14 getScale <- function(mode, title, vals) { 20 getScale <- function(mode, title, vals) {
15 if (vals > 12) return(do.call(paste("scale", mode, "discrete", sep="_"), list(title))) 21 if (vals > 12) return(do.call(paste("scale", mode, "discrete", sep="_"), list(title)))
@@ -45,7 +51,7 @@ plotTable &lt;- function(tableData=NULL, name=NULL, labels=NULL) { @@ -45,7 +51,7 @@ plotTable &lt;- function(tableData=NULL, name=NULL, labels=NULL) {
45 input = tableData$Y 51 input = tableData$Y
46 } 52 }
47 mat <- matrix(input, nrow=length(labels), ncol=length(algs), byrow=FALSE) 53 mat <- matrix(input, nrow=length(labels), ncol=length(algs), byrow=FALSE)
48 - colnames(mat) <- algs[order(tolower(algs))] 54 + colnames(mat) <- algs
49 rownames(mat) <- labels 55 rownames(mat) <- labels
50 table <- as.table(mat) 56 table <- as.table(mat)
51 if (csv) { 57 if (csv) {