FRTE/IREX Ongoing
API Specification for the FRTE 1:N and IREX Evaluations
frvt1N.h
1/*
2 * This software was developed at the National Institute of Standards and
3 * Technology (NIST) by employees of the Federal Government in the course
4 * of their official duties. Pursuant to title 17 Section 105 of the
5 * United States Code, this software is not subject to copyright protection
6 * and is in the public domain. NIST assumes no responsibility whatsoever for
7 * its use by other parties, and makes no guarantees, expressed or implied,
8 * about its quality, reliability, or any other characteristic.
9 */
10
11#ifndef FRVT1N_H_
12#define FRVT1N_H_
13
14#include <cstdint>
15#include <string>
16#include <vector>
17
18#include <frvt_structs.h>
19
20namespace FRVT_1N {
21
25enum class GalleryType {
27 Consolidated = 0,
29 Unconsolidated = 1
30};
31
36typedef struct Candidate {
42
44 std::string templateId;
45
52 double score;
53
54 Candidate() :
55 isAssigned{false},
56 templateId{""},
57 score{-1.0}
58 {}
59
61 bool isAssigned,
62 std::string templateId,
63 double score) :
64 isAssigned{isAssigned},
65 templateId{templateId},
66 score{score}
67 {}
68} Candidate;
69
78class Interface {
79public:
80 virtual ~Interface() {}
81
100 virtual FRVT::ReturnStatus
102 const std::string &configDir,
103 FRVT::TemplateRole role) = 0;
104
145 virtual FRVT::ReturnStatus
147 const std::vector<FRVT::Image> &faces,
148 FRVT::TemplateRole role,
149 std::vector<uint8_t> &templ,
150 std::vector<FRVT::EyePair> &eyeCoordinates) = 0;
151
187 virtual FRVT::ReturnStatus
189 const FRVT::Image &image,
190 FRVT::TemplateRole role,
191 std::vector<std::vector<uint8_t>> &templ,
192 std::vector<FRVT::EyePair> &eyeCoordinates) = 0;
193
230 virtual FRVT::ReturnStatus
232 const std::vector<FRVT::Image> &irises,
233 FRVT::TemplateRole role,
234 std::vector<uint8_t> &templ,
235 std::vector<FRVT::IrisAnnulus> &irisLocations) = 0;
236
274 virtual FRVT::ReturnStatus
276 const std::vector<FRVT::Image> &facesIrises,
277 FRVT::TemplateRole role,
278 std::vector<uint8_t> &templ) = 0;
279
327 virtual FRVT::ReturnStatus
329 const std::string &configDir,
330 const std::string &enrollmentDir,
331 const std::string &edbName,
332 const std::string &edbManifestName,
333 FRVT_1N::GalleryType galleryType) = 0;
334
350 virtual FRVT::ReturnStatus
352 const std::string &configDir,
353 const std::string &enrollmentDir) = 0;
354
383 virtual FRVT::ReturnStatus
385 const std::vector<uint8_t> &idTemplate,
386 const uint32_t candidateListLength,
387 std::vector<FRVT_1N::Candidate> &candidateList) = 0;
388
400 static std::shared_ptr<Interface>
402};
403
404/*
405 * API versioning
406 *
407 * NIST code will extern the version number symbols.
408 * Participant shall compile them into their core library.
409 */
410#ifdef NIST_EXTERN_API_VERSION
412extern uint16_t API_MAJOR_VERSION;
414extern uint16_t API_MINOR_VERSION;
415#else /* NIST_EXTERN_API_VERSION */
417uint16_t API_MAJOR_VERSION{3};
419uint16_t API_MINOR_VERSION{0};
420#endif /* NIST_EXTERN_API_VERSION */
421}
422
423#endif /* FRVT1N_H_ */
The interface to FRVT 1:N implementation.
Definition: frvt1N.h:78
virtual FRVT::ReturnStatus initializeIdentification(const std::string &configDir, const std::string &enrollmentDir)=0
This function will be called once prior to one or more calls to identifyTemplate().
virtual FRVT::ReturnStatus createFaceAndIrisTemplate(const std::vector< FRVT::Image > &facesIrises, FRVT::TemplateRole role, std::vector< uint8_t > &templ)=0
This function supports template generation from one or more face and/or iris images of exactly one pe...
virtual FRVT::ReturnStatus finalizeEnrollment(const std::string &configDir, const std::string &enrollmentDir, const std::string &edbName, const std::string &edbManifestName, FRVT_1N::GalleryType galleryType)=0
This function will be called after all enrollment templates have been created and freezes the enrollm...
virtual FRVT::ReturnStatus createFaceTemplate(const std::vector< FRVT::Image > &faces, FRVT::TemplateRole role, std::vector< uint8_t > &templ, std::vector< FRVT::EyePair > &eyeCoordinates)=0
This function supports template generation from one or more face images of exactly one person.
virtual FRVT::ReturnStatus initializeTemplateCreation(const std::string &configDir, FRVT::TemplateRole role)=0
Before images are sent to the template creation function, the test harness will call this initializat...
static std::shared_ptr< Interface > getImplementation()
Factory method to return a managed pointer to the Interface object.
virtual FRVT::ReturnStatus createIrisTemplate(const std::vector< FRVT::Image > &irises, FRVT::TemplateRole role, std::vector< uint8_t > &templ, std::vector< FRVT::IrisAnnulus > &irisLocations)=0
This function supports template generation from one or more iris images of exactly one person.
virtual FRVT::ReturnStatus createFaceTemplate(const FRVT::Image &image, FRVT::TemplateRole role, std::vector< std::vector< uint8_t > > &templ, std::vector< FRVT::EyePair > &eyeCoordinates)=0
This function supports face template generation of one or more people detected from a single image.
virtual FRVT::ReturnStatus identifyTemplate(const std::vector< uint8_t > &idTemplate, const uint32_t candidateListLength, std::vector< FRVT_1N::Candidate > &candidateList)=0
This function searches an identification template against the enrollment set, and outputs a vector co...
Data structure for result of an identification search.
Definition: frvt1N.h:36
bool isAssigned
If the candidate is valid, this should be set to true.
Definition: frvt1N.h:41
double score
Measure of similarity or dissimilarity between the identification template and the enrolled candidate...
Definition: frvt1N.h:52
std::string templateId
The template ID from the enrollment database manifest.
Definition: frvt1N.h:44