Enrollment
28.2.0
Theme:
Default
Robot
Toggle main menu visibility
Loading...
Searching...
No Matches
EmbeddingVerifyMatcher.h
Go to the documentation of this file.
1
9
10
#pragma once
11
12
#include "enrollment/Export.h"
13
#include "
enrollment/Logger/FormattingLogger.h
"
14
#include "
enrollment/Print/EmbeddingMatcher.h
"
15
#include "
enrollment/Print/EmbeddingTemplate.h
"
16
#include "
enrollment/Print/PrintExecutor.h
"
17
#include "
enrollment/Serialization/Writer.h
"
18
#include "
enrollment/SimilarityScore.h
"
19
#include <array>
20
#include <memory>
21
#include <mutex>
22
#include <vector>
23
24
namespace
inno
25
{
26
class
Logger;
33
*/
34
class
EmbeddingVerifyMatcher
:
public
EmbeddingMatcher
35
{
36
public
:
48
*/
49
[[nodiscard]]
PrintSimilarityScore
Match
(
const
EmbeddingTemplate
& probe,
50
const
EmbeddingTemplate
& gallery)
const
final
51
{
52
log.LogInfo(
"Matching embeddings probe %v and gallery %v"
, probe, gallery);
53
const
CallbackLogger
slog(log.GetLogger());
54
55
const
float
score = exec->MatchEmbedding(module.get(),
56
probe.embeddingTemplateData.data(),
57
static_cast<
unsigned
int
>
(probe.embeddingTemplateData.size()),
58
gallery.embeddingTemplateData.data(),
59
static_cast<
unsigned
int
>
(gallery.embeddingTemplateData.size()),
60
slog.
GetCallbacks
(),
61
ThrowOnError{});
62
63
log.LogInfo(
"Matching embeddings probe %v and gallery %v with score %f"
, probe, gallery, score);
64
return
static_cast<
PrintSimilarityScore
>
(score);
65
}
66
71
*/
72
EmbeddingVerifyMatcher
()
73
: log(
GlobalLogger
::Get())
74
, exec(
GlobalPrintExecutor
::Get())
75
, module(Initialize())
76
{
77
}
78
84
*/
85
explicit
EmbeddingVerifyMatcher
(std::shared_ptr<PrintExecutor> executor)
86
: log(
GlobalLogger
::Get())
87
, exec(std::move(executor))
88
, module(Initialize())
89
{
90
if
(exec ==
nullptr
)
91
{
92
throw
NullArgumentException
(
"executor can not be null"
);
93
}
94
}
95
96
EmbeddingVerifyMatcher
(
const
EmbeddingVerifyMatcher
&) =
delete
;
97
EmbeddingVerifyMatcher
(
EmbeddingVerifyMatcher
&&) =
delete
;
98
EmbeddingVerifyMatcher
& operator=(
const
EmbeddingVerifyMatcher
&) =
delete
;
99
EmbeddingVerifyMatcher
& operator=(
EmbeddingVerifyMatcher
&&) =
delete
;
100
virtual
~EmbeddingVerifyMatcher
() =
default
;
101
102
private
:
109
std::unique_ptr<void, inno_Deleter>
Initialize
()
110
{
111
if
(exec ==
nullptr
)
112
{
113
throw
NullArgumentException
(
"executor can not be null"
);
114
}
115
116
inno_Deleter moduleDeleter =
nullptr
;
117
auto
* mod = exec->IFingerCreateMatchingModule(&moduleDeleter, ThrowOnError{});
118
std::unique_ptr<void, inno_Deleter> matcherModule(mod, moduleDeleter);
119
120
return
matcherModule;
121
}
122
123
FormattingLogger log;
124
std::shared_ptr<PrintExecutor> exec;
125
std::unique_ptr<void, inno_Deleter> module;
126
};
127
}
// namespace inno
EmbeddingMatcher.h
EmbeddingTemplate.h
FormattingLogger.h
PrintExecutor.h
SimilarityScore.h
Writer.h
CallbackLogger
CallbackLogger is logger for binary part of libary due to C boundary.
Definition
Logger.h:157
CallbackLogger::GetCallbacks
LoggerCallBacks GetCallbacks() const
Get the Callbacks object.
Definition
Logger.h:166
EmbeddingTemplate
Print template in proprietary embedding format used for biometric operations.
Definition
EmbeddingTemplate.h:30
EmbeddingVerifyMatcher
EmbeddingVerifyMatcher is template matcher that uses Innovatrics proprietary verification algorithm.
Definition
EmbeddingVerifyMatcher.h:34
EmbeddingVerifyMatcher::Match
PrintSimilarityScore Match(const EmbeddingTemplate &probe, const EmbeddingTemplate &gallery) const final
Calculates similarity score of probe and gallery template.
Definition
EmbeddingVerifyMatcher.h:48
EmbeddingVerifyMatcher::EmbeddingVerifyMatcher
EmbeddingVerifyMatcher(std::shared_ptr< PrintExecutor > executor)
Constructor with custom executor .
Definition
EmbeddingVerifyMatcher.h:84
EmbeddingVerifyMatcher::EmbeddingVerifyMatcher
EmbeddingVerifyMatcher()
Constructor with default logger, executor and matcher module GlobalPrintExecutor is used to execute m...
Definition
EmbeddingVerifyMatcher.h:71
GlobalLogger
Holds instance of Logger.
Definition
Logger.h:275
GlobalPrintExecutor
Holds instance of PrintExecutor.
Definition
PrintExecutor.h:1300
Logger
Interface for library logging.
Definition
Logger.h:45
NullArgumentException
Null argument is not allowed.
Definition
EnrollmentException.h:156
Initialize
static void Initialize(const InitializerConfig &config)
Initialize SDK from InitializerConfig (license, models path, and thread counts).
Definition
Initializer.h:114
PrintSimilarityScore
unsigned int PrintSimilarityScore
It is similarity score between print Templates.
Definition
SimilarityScore.h:28
Print
EmbeddingVerifyMatcher.h
Generated by
1.17.0