forked from linuxdeepin/deepin-face
-
Notifications
You must be signed in to change notification settings - Fork 0
/
drivermanger.h
88 lines (76 loc) · 2.58 KB
/
drivermanger.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#ifndef DRIVERMANGER_H
#define DRIVERMANGER_H
#include "charadatamanger.h"
#include "definehead.h"
#include "seeta/CTrackingFaceInfo.h"
#include "seeta/FaceAntiSpoofing.h"
#include "seeta/FaceDetector.h"
#include "seeta/FaceLandmarker.h"
#include "seeta/FaceRecognizer.h"
#include "seeta/FaceTracker.h"
#include "seeta/QualityAssessor.h"
#include "seeta/QualityOfPoseEx.h"
#include "workmodule.h"
#include <QFileSystemWatcher>
#include <QSharedPointer>
#include <QtDBus/QtDBus>
#include <memory>
struct ActionInfo {
QString chara; // DA生成特征值
qint32 status;
ActionType actionType;
float *faceChara;
int size;
};
struct ErrMsgInfo {
QDBusError::ErrorType errType;
QString msg;
};
class DriverManger : public QObject, public QEnableSharedFromThis<DriverManger>
{
Q_OBJECT
public:
DriverManger();
virtual ~DriverManger();
void init();
QDBusUnixFileDescriptor enrollStart(QString chara,
qint32 charaType,
QString actionId,
ErrMsgInfo &errMsgInfo);
void enrollStop(QString actionId, ErrMsgInfo &errMsgInfo);
QDBusUnixFileDescriptor verifyStart(QStringList charas,
QString actionId,
ErrMsgInfo &errMsgInfo);
void verifyStop(QString actionId, ErrMsgInfo &errMsgInfo);
void deleteChara(QString chara, ErrMsgInfo &errMsgInfo);
public Q_SLOTS:
void processStatus(QString actionId, qint32 status, float *faceChara = nullptr, int size = 0);
public:
bool getClaim();
void setClaim(bool bClaim);
qint32 getCharaType();
void setCharaType(qint32 qCharaType);
QStringList getCharaList();
void setCharaList(QStringList lCharaList);
private Q_SLOTS:
void onDirectoryChanged(const QString &path);
private:
QString getStatusMsg(ActionType actionType, qint32 status);
void emitPropertiesChanged(QVariantMap &qVariantMap);
void emitStatus(ActionType action, QString actionId, qint32 status, QString msg);
private:
QSharedPointer<ErollThread> m_spErollthread;
QSharedPointer<VerifyThread> m_spVerifyThread;
QSharedPointer<CharaDataManger> m_spCharaDataManger;
QMap<QString, ActionInfo> m_actionMap;
bool m_bClaim; //是否被占用
qint32 m_charaType;
QStringList m_charalist;
QSharedPointer<QFileSystemWatcher> m_spFileWatch;
QThread *m_eroll;
QThread *m_verify;
};
#endif