DFace SDK  2.0.0
LTM
dface_database.h
1 //
2 // Created by asy on 11/24/18.
3 //
4 
5 #ifndef DFACE_DATABASE_H
6 #define DFACE_DATABASE_H
7 
8 #include <stdio.h>
9 #include <string>
10 #include <vector>
11 
12 using namespace std;
13 
19 class DfaceDB{
20  public:
21  DfaceDB() {};
22  virtual ~DfaceDB() { return; };
23 
30  virtual bool openDB(const std::string &db_file) = 0;
31 
37  virtual bool closeDB() = 0;
38 
45  virtual bool dbExsitCollection(const string &collection_name) = 0;
46 
53  virtual bool dbCreateCollection(const string &collection_name) = 0;
54 
55 
70  virtual int insertFace(const std::string &collection_name, const std::vector<float> &feature, const std::string &additional_json_str = "") = 0;
71 
72 
82  virtual int fetchFaceById(const std::string &collection_name, const int id, std::vector<float> &out_feature, std::string &out_json_str) = 0;
83 
84 
92  virtual bool deleteFaceById(const std::string &collection_name, const int id) = 0;
93 
94 
106  virtual int fetchAllFace2Memory(const std::string &collection_name, std::vector<int> &out_idx, std::vector<std::vector<float>> &out_feature, std::string condition_func_str = "") = 0;
107 
114  virtual int totalCollectionRecord(const std::string &collection_name) = 0;
115 
116 
130  virtual int insert(const std::string &collection_name, const std::string &json_str) = 0;
131 
132 
142  virtual int fetchById(const std::string &collection_name, const int id, std::string &out_json_str) = 0;
143 
151  virtual bool deleteById(const std::string &collection_name, const int id) = 0;
152 
153 
164  virtual int fetchAll(const std::string &collection_name, std::vector<std::string> &out_json, std::string condition_func_str = "") = 0;
165 
166 };
167 
168 
172 typedef DfaceDB* CreateDfaceDB();
173 
178 typedef void DestroyDfaceDB(DfaceDB* db);
179 
180 
181 #endif //DFACE_DATABASE_H
DFaceDB人脸数据库API抽象层(DfaceDB) 非关系nosql人脸数据库(单文件),支持动态添加属性,适应任意应用场景...
Definition: dface_database.h:19