Commit d93507d9da8ca0d86028645224e920cef72035d6

Authored by caotto
2 parents 13375616 39dee1e8

Merge pull request #295 from biometrics/default_gallery

Discard templates on empty enroll output
Showing 1 changed file with 7 additions and 3 deletions
openbr/core/core.cpp
... ... @@ -172,9 +172,10 @@ struct AlgorithmCore
172 172 qDebug("Enrolling %s%s", qPrintable(input.flat()),
173 173 gallery.isNull() ? "" : qPrintable(" to " + gallery.flat()));
174 174  
  175 + bool noOutput = false;
175 176 if (gallery.name.isEmpty()) {
176 177 if (input.name.isEmpty()) return;
177   - else gallery = getMemoryGallery(input);
  178 + else noOutput = true;
178 179 }
179 180  
180 181 bool multiProcess = Globals->file.getBool("multiProcess", false);
... ... @@ -200,12 +201,15 @@ struct AlgorithmCore
200 201 QString outputDesc;
201 202 if (fileExclusion)
202 203 outputDesc = "FileExclusion(" + gallery.flat() + ")+";
203   - outputDesc.append("GalleryOutput("+gallery.flat()+")");
  204 + if (!noOutput)
  205 + outputDesc.append("GalleryOutput("+gallery.flat()+")+");
  206 +
  207 + outputDesc = outputDesc + "DiscardTemplates";
204 208 stages.append(progressCounter.data());
205 209  
206 210 QScopedPointer<Transform> pipeline(pipeTransforms(stages));
207 211  
208   - QScopedPointer<Transform> stream(wrapTransform(pipeline.data(), "Stream(readMode=StreamGallery, endPoint="+outputDesc+"+DiscardTemplates)"));
  212 + QScopedPointer<Transform> stream(wrapTransform(pipeline.data(), "Stream(readMode=StreamGallery, endPoint="+outputDesc+")"));
209 213  
210 214 TemplateList data, output;
211 215 data.append(input);
... ...