Commit f1fe5e78635a6e4f1480a82632162bd768476963

Authored by Josh Klontz
1 parent 0ffc0a8f

training bug fix

sdk/openbr_plugin.cpp
@@ -868,6 +868,7 @@ void MatrixOutput::initialize(const FileList &targetFiles, const FileList &query @@ -868,6 +868,7 @@ void MatrixOutput::initialize(const FileList &targetFiles, const FileList &query
868 data.create(queryFiles.size(), targetFiles.size(), CV_32FC1); 868 data.create(queryFiles.size(), targetFiles.size(), CV_32FC1);
869 } 869 }
870 870
  871 +/* MatrixOutput - protected methods */
871 QString MatrixOutput::toString(int row, int column) const 872 QString MatrixOutput::toString(int row, int column) const
872 { 873 {
873 if (targetFiles[column] == "Label") 874 if (targetFiles[column] == "Label")
@@ -881,6 +882,8 @@ void MatrixOutput::set(float value, int i, int j) @@ -881,6 +882,8 @@ void MatrixOutput::set(float value, int i, int j)
881 data.at<float>(i,j) = value; 882 data.at<float>(i,j) = value;
882 } 883 }
883 884
  885 +BR_REGISTER(Output, MatrixOutput)
  886 +
884 /* Gallery - public methods */ 887 /* Gallery - public methods */
885 TemplateList Gallery::read() 888 TemplateList Gallery::read()
886 { 889 {
@@ -1164,7 +1167,7 @@ void Distance::train(const TemplateList &amp;templates) @@ -1164,7 +1167,7 @@ void Distance::train(const TemplateList &amp;templates)
1164 { 1167 {
1165 const TemplateList samples = templates.mid(0, 2000); 1168 const TemplateList samples = templates.mid(0, 2000);
1166 const QList<float> sampleLabels = samples.labels<float>(); 1169 const QList<float> sampleLabels = samples.labels<float>();
1167 - QSharedPointer<MatrixOutput> memoryOutput((MatrixOutput*)Output::make("Matrix", FileList(samples.size()), FileList(samples.size()))); 1170 + QScopedPointer<MatrixOutput> memoryOutput(dynamic_cast<MatrixOutput*>(Output::make(".Matrix", FileList(samples.size()), FileList(samples.size()))));
1168 compare(samples, samples, memoryOutput.data()); 1171 compare(samples, samples, memoryOutput.data());
1169 1172
1170 double genuineAccumulator, impostorAccumulator; 1173 double genuineAccumulator, impostorAccumulator;
sdk/openbr_plugin.h
@@ -703,6 +703,7 @@ protected: @@ -703,6 +703,7 @@ protected:
703 703
704 const QString abstraction = baseClassName(); 704 const QString abstraction = baseClassName();
705 if (name.endsWith(abstraction)) name = name.left(name.size()-abstraction.size()); 705 if (name.endsWith(abstraction)) name = name.left(name.size()-abstraction.size());
  706 + if (name.startsWith("br::")) name = name.right(name.size()-4);
706 if (registry->contains(name)) qFatal("%s registry already contains object named: %s", qPrintable(abstraction), qPrintable(name)); 707 if (registry->contains(name)) qFatal("%s registry already contains object named: %s", qPrintable(abstraction), qPrintable(name));
707 registry->insert(name, this); 708 registry->insert(name, this);
708 } 709 }