Commit 097e9105746eaf97f61ba5997fb0caf0d3f9de8e

Authored by Brendan Klare
1 parent f83ba8b7

FDDB import to list of rects for slidingWindow compatability

Showing 1 changed file with 5 additions and 2 deletions
openbr/plugins/gallery.cpp
@@ -857,18 +857,21 @@ class FDDBGallery : public Gallery @@ -857,18 +857,21 @@ class FDDBGallery : public Gallery
857 for (int i=0; i<numDetects; i++) { 857 for (int i=0; i<numDetects; i++) {
858 const QStringList detect = lines.takeFirst().split(' '); 858 const QStringList detect = lines.takeFirst().split(' ');
859 Template t(fileName); 859 Template t(fileName);
  860 + QList<QVariant> faceList; //to be consistent with slidingWindow
860 if (detect.size() == 5) { //rectangle 861 if (detect.size() == 5) { //rectangle
861 - t.file.set("Face", QRectF(detect[0].toFloat(), detect[1].toFloat(), detect[2].toFloat(), detect[3].toFloat())); 862 + faceList.append(QRectF(detect[0].toFloat(), detect[1].toFloat(), detect[2].toFloat(), detect[3].toFloat()));
862 t.file.set("Confidence", detect[4].toFloat()); 863 t.file.set("Confidence", detect[4].toFloat());
863 } else if (detect.size() == 6) { //ellipse 864 } else if (detect.size() == 6) { //ellipse
864 float x = detect[3].toFloat(), 865 float x = detect[3].toFloat(),
865 y = detect[4].toFloat(), 866 y = detect[4].toFloat(),
866 radius = detect[1].toFloat(); 867 radius = detect[1].toFloat();
867 - t.file.set("Face", QRectF(x - radius,y - radius,radius * 2.0, radius * 2.0)); 868 + faceList.append(QRectF(x - radius,y - radius,radius * 2.0, radius * 2.0));
868 t.file.set("Confidence", detect[5].toFloat()); 869 t.file.set("Confidence", detect[5].toFloat());
869 } else { 870 } else {
870 qFatal("Unknown FDDB annotation format."); 871 qFatal("Unknown FDDB annotation format.");
871 } 872 }
  873 + t.file.set("Face", faceList);
  874 + t.file.set("Label",QString("face"));
872 templates.append(t); 875 templates.append(t);
873 } 876 }
874 } 877 }