Commit 4b9adf5dc0a7c62bc40a3d2b391f1a35c0839174
1 parent
5c7fd6bf
merging
Showing
2 changed files
with
6 additions
and
5 deletions
sdk/core/plot.cpp
| @@ -120,7 +120,7 @@ float Evaluate(const QString &simmat, const QString &mask, const QString &csv) | @@ -120,7 +120,7 @@ float Evaluate(const QString &simmat, const QString &mask, const QString &csv) | ||
| 120 | const Mat scores = BEE::readSimmat(simmat); | 120 | const Mat scores = BEE::readSimmat(simmat); |
| 121 | File maskFile(mask); maskFile.insert("Size", scores.rows); | 121 | File maskFile(mask); maskFile.insert("Size", scores.rows); |
| 122 | const Mat masks = BEE::readMask(maskFile); | 122 | const Mat masks = BEE::readMask(maskFile); |
| 123 | - if (scores.size() != masks.size()) qFatal("Simmat/Mask size mismatch."); | 123 | + if (scores.size() != masks.size()) qFatal("Simmat %i /Mask %i size mismatch.", scores.size(), mask.size()); |
| 124 | 124 | ||
| 125 | // Make comparisons | 125 | // Make comparisons |
| 126 | QList<Comparison> comparisons; comparisons.reserve(scores.rows*scores.cols); | 126 | QList<Comparison> comparisons; comparisons.reserve(scores.rows*scores.cols); |
sdk/plugins/output.cpp
| @@ -278,7 +278,7 @@ class rankOutput : public MatrixOutput | @@ -278,7 +278,7 @@ class rankOutput : public MatrixOutput | ||
| 278 | typedef QPair<float,int> Pair; | 278 | typedef QPair<float,int> Pair; |
| 279 | int rank = 1; | 279 | int rank = 1; |
| 280 | foreach (const Pair &pair, Common::Sort(OpenCVUtils::matrixToVector(data.row(i)), true)) { | 280 | foreach (const Pair &pair, Common::Sort(OpenCVUtils::matrixToVector(data.row(i)), true)) { |
| 281 | - if(targetFiles[pair.second].label() == queryFiles[i].label()) { | 281 | + if(targetFiles[pair.second].getString("Label") == queryFiles[i].getString("Label")) { |
| 282 | ranks.append(rank); | 282 | ranks.append(rank); |
| 283 | scores.append(pair.first); | 283 | scores.append(pair.first); |
| 284 | break; | 284 | break; |
| @@ -288,9 +288,10 @@ class rankOutput : public MatrixOutput | @@ -288,9 +288,10 @@ class rankOutput : public MatrixOutput | ||
| 288 | } | 288 | } |
| 289 | 289 | ||
| 290 | typedef QPair<int,int> RankPair; | 290 | typedef QPair<int,int> RankPair; |
| 291 | - foreach (const RankPair &pair, Common::Sort(ranks, false)) | ||
| 292 | - lines.append(queryFiles[pair.second].name + " " + QString::number(pair.first) + " " + QString::number(scores[pair.second]) + " " + targetFiles[pair.second].name); | ||
| 293 | - | 291 | + foreach (const RankPair &pair, Common::Sort(ranks, false)) { |
| 292 | + qDebug() << ranks[pair.second]; | ||
| 293 | + lines.append(queryFiles[pair.second].name + " " + QString::number(pair.first) + " " + QString::number(scores[pair.second]) + " " + targetFiles[ranks[pair.second]].name); | ||
| 294 | +} | ||
| 294 | QtUtils::writeFile(file, lines); | 295 | QtUtils::writeFile(file, lines); |
| 295 | } | 296 | } |
| 296 | }; | 297 | }; |