9 #include <voicesdk/verify/verify.h>
25 std::vector<size_t> indexes;
27 for (
size_t i = 0; i <
scores.size(); ++i) {
41 for (
const auto& score :
scores) {
51 os <<
"IdentificationList["
54 for (
const auto& s : obj.
scores) {
59 os <<
"threshold: " << obj.
threshold <<
"]";
83 using Ptr = std::shared_ptr<IdentificationList>;
89 virtual void Serialize(std::ostream& stream)
const = 0;
96 static IdentificationList::Ptr
Deserialize(std::istream& stream);
106 using Ptr = std::shared_ptr<IdentificationEngine>;
113 static Ptr
Create(
const std::string& initDataPath);
122 const std::vector<voicesdk::VoiceTemplate::Ptr>& voice_templates) = 0;
135 const IdentificationList::Ptr& identification_list,
136 const float acceptance_level = -2.0f) = 0;
145 const std::vector<voicesdk::VoiceTemplate::Ptr>& voice_templates) = 0;
Identification engine class used for creating identification list and for identification itself.
Definition: identification.h:104
virtual IdentificationResult Identify(const voicesdk::VoiceTemplate::Ptr &voice_template, const IdentificationList::Ptr &identification_list, const float acceptance_level=-2.0f)=0
Performs an identification of given voice template using given identification list.
virtual void EnrichIdentificationList(const IdentificationList::Ptr &identification_list, const std::vector< voicesdk::VoiceTemplate::Ptr > &voice_templates)=0
Enrich identification list with new templates.
virtual IdentificationList::Ptr CreateIdentificationList(const std::vector< voicesdk::VoiceTemplate::Ptr > &voice_templates)=0
Creates a list for identification from given voice templates.
static Ptr Create(const std::string &initDataPath)
Factory method used for creating an instance of identification engine.
Structure containing list for identification.
Definition: identification.h:82
virtual void Serialize(std::ostream &stream) const =0
Serializes identification list to an output stream.
static IdentificationList::Ptr Deserialize(std::istream &stream)
Deserializes identification list from an input stream.
Structure containing identification result.
Definition: identification.h:17
float threshold
Similarity score threshold, supposed to be used to make a decision about if corresponding voice templ...
Definition: identification.h:76
std::vector< size_t > GetIndexesOfMatchedTemplates() const
Returns indexes of templates stored (i.e. used for creation) identification list which are considered...
Definition: identification.h:24
std::vector< float > scores
Contains similarity score for each template sorted in according to templates identification list was ...
Definition: identification.h:68
bool IsMatched() const
Check whether voice template was matched or not.
Definition: identification.h:40