diff --git a/openbr/plugins/classification/caffe.cpp b/openbr/plugins/classification/caffe.cpp index 7445391..c0d160d 100644 --- a/openbr/plugins/classification/caffe.cpp +++ b/openbr/plugins/classification/caffe.cpp @@ -45,6 +45,7 @@ private: CaffeNet *net = new CaffeNet(model, caffe::TEST); net->CopyTrainedLayersFrom(weights.toStdString()); + FLAGS_minloglevel = google::ERROR; // Disable Caffe's verbose output after loading the first model return net; } }; @@ -104,7 +105,7 @@ protected: int dimFeatures = output->count() / dataLayer->batch_size(); for (int n = 0; n < dataLayer->batch_size(); n++) - dst += Mat(1, dimFeatures, CV_32FC1, output->mutable_cpu_data() + output->offset(n)); + dst += Mat(1, dimFeatures, CV_32FC1, output->mutable_cpu_data() + output->offset(n)).clone(); caffeResource.release(net); } diff --git a/openbr/plugins/gallery/lmdb.cpp b/openbr/plugins/gallery/lmdb.cpp index 8dea0f2..84a1176 100644 --- a/openbr/plugins/gallery/lmdb.cpp +++ b/openbr/plugins/gallery/lmdb.cpp @@ -119,7 +119,7 @@ class lmdbGallery : public Gallery if (!base->observedLabels.contains(label_str) ) - base->observedLabels[label_str] = base->observedLabels.size(); + base->observedLabels.insert(label_str, base->observedLabels.size()); datum.set_label(base->observedLabels[label_str]); diff --git a/share/openbr/plotting/plot_utils.R b/share/openbr/plotting/plot_utils.R index 82a7f0c..ec7a7c3 100644 --- a/share/openbr/plotting/plot_utils.R +++ b/share/openbr/plotting/plot_utils.R @@ -9,7 +9,13 @@ library("grid") # Code to format FAR values far_names <- list('0.001'="FAR = 0.1%", '0.01'="FAR = 1%") -far_labeller <- function(variable,value) { return(far_names[as.character(value)]) } +far_labeller <- function(variable,value) { + if (as.character(value) %in% names(far_names)) { + return(far_names[as.character(value)]) + } else { + return(as.character(value)) + } +} getScale <- function(mode, title, vals) { if (vals > 12) return(do.call(paste("scale", mode, "discrete", sep="_"), list(title))) @@ -45,7 +51,7 @@ plotTable <- function(tableData=NULL, name=NULL, labels=NULL) { input = tableData$Y } mat <- matrix(input, nrow=length(labels), ncol=length(algs), byrow=FALSE) - colnames(mat) <- algs[order(tolower(algs))] + colnames(mat) <- algs rownames(mat) <- labels table <- as.table(mat) if (csv) {