Commit a9b62f7a1bc5fe5d9daf109680665e5ff4357f14

Authored by Josh Klontz
1 parent e882744d

PP5 now supports mult-signature templates

Showing 1 changed file with 8 additions and 6 deletions
openbr/plugins/pp5.cpp
@@ -368,14 +368,16 @@ class PP5CompareDistance : public Distance @@ -368,14 +368,16 @@ class PP5CompareDistance : public Distance
368 { 368 {
369 int subject_id = 0, face_id = 0; 369 int subject_id = 0, face_id = 0;
370 foreach (const Template &src, templates) { 370 foreach (const Template &src, templates) {
371 - if (src.m().data) {  
372 - ppr_face_type face;  
373 - createFace(src, &face);  
374 - TRY(ppr_add_face(context, gallery, face, subject_id, face_id)) 371 + if (!src.empty() && src.m().data) {
  372 + foreach (const cv::Mat &m, src) {
  373 + ppr_face_type face;
  374 + createFace(m, &face);
  375 + TRY(ppr_add_face(context, gallery, face, subject_id, face_id))
  376 + face_id++;
  377 + ppr_free_face(face);
  378 + }
375 subject_ids.append(subject_id); 379 subject_ids.append(subject_id);
376 subject_id++; 380 subject_id++;
377 - face_id++;  
378 - ppr_free_face(face);  
379 } else { 381 } else {
380 subject_ids.append(-1); 382 subject_ids.append(-1);
381 } 383 }