visageSDK

VisageFaceRecognition.h
1 //
3 // (c) Visage Technologies AB 2002 - 2023 All rights reserved.
4 //
5 // This file is part of visage|SDK(tm).
6 // Unauthorized copying of this file, via any medium is strictly prohibited.
7 //
8 // No warranty, explicit or implicit, provided.
9 //
10 // This is proprietary software. No part of this software may be used or
11 // reproduced in any form or by any means otherwise than in accordance with
12 // any written license granted by Visage Technologies AB.
13 //
15
16 #ifndef VSDK_VISAGEFACERECOGNITION_H
17 #define VSDK_VISAGEFACERECOGNITION_H
18
19 #ifdef VISAGE_STATIC
20 #define VISAGE_ANALYSER_DECLSPEC
21 #else
22
23 #ifdef VISAGE_ANALYSER_EXPORTS
24 #define VISAGE_ANALYSER_DECLSPEC __declspec(dllexport)
25 #else
26 #define VISAGE_ANALYSER_DECLSPEC __declspec(dllimport)
27 #endif
28
29 #endif
30
31 #include "FaceData.h"
32
33 namespace VNN
34 {
35 class INNFrontend;
36 class INNRunner;
37 }
38
39 namespace VisageSDK
40 {
41
42 #ifndef ANDROID
43 int VISAGE_DECLSPEC initializeLicenseManager(const char *licenseKeyFileFolder);
44 #endif
45
50 const VISAGE_DECLSPEC char* getVisageSDKVersion(void);
51
52 class VisageNNModel;
53 class VisageNNRunner;
54
87 class VISAGE_ANALYSER_DECLSPEC VisageFaceRecognition
88 {
89
90 private:
91 VNN::INNFrontend* m_frontend;
92 VNN::INNRunner* m_runner;
93 std::vector<std::pair<short*, std::string > > m_descriptors;
94 std::vector<std::pair<float, std::string > > m_result;
95 int m_descriptorSize;
96
97 public:
98
113 bool is_initialized;
114
115 #ifdef EMSCRIPTEN
116
118 VisageFaceRecognition();
119 #endif
120
141 VisageFaceRecognition(const char* dataPath);
144 ~VisageFaceRecognition();
145
152 int getDescriptorSize();
153
204 int extractDescriptor(FaceData *facedata, VsImage *image, short *descriptor);
205
214 float descriptorsSimilarity(short *first_descriptor, short *second_descriptor);
215
225 int addDescriptor(VsImage *image, FaceData *facedata, const char *name);
226
233 int addDescriptor(short *descriptor, const char *name);
234
238 int getDescriptorCount();
239
245 int getDescriptorName(char* name, int index);
246
252 int replaceDescriptorName(const char* name, int index);
253
258 int removeDescriptor(int index);
259
265 int saveGallery(const char *file_name);
266
272 int loadGallery(const char *file_name);
273
276 void resetGallery();
277
287 int recognize(short *descriptor, int n, const char** names, float* similarities);
288 };
289
290 }
291
292 #endif
VisageSDK::VisageFaceRecognition
VisageFaceRecognition class contains a face recognition algorithm capable of measuring similarity bet...
Definition: VisageFaceRecognition.h:87
VNN
Definition: VisageFeaturesDetector.h:34
VisageSDK::VisageFaceRecognition::is_initialized
bool is_initialized
If the model used in the VisageFaceRecognition is loaded and initialized successfully value of the is...
Definition: VisageFaceRecognition.h:113
VisageSDK
Namespace.
Definition: linux_header.h:1
VisageSDK::getVisageSDKVersion
const VISAGE_DECLSPEC char * getVisageSDKVersion(void)
Returns visageSDK version and revision number.
VisageSDK::FaceData
Face data structure, used as container for all face tracking and detection results.
Definition: FaceData.h:259
VsImage
Image store container.
Definition: vs_core_types_c.h:460