PFaceMetaData.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2018 Digital Barriers plc. All rights reserved.
3  * Contact: http://www.digitalbarriers.com/
4  *
5  * This file is part of the Papillon SDK.
6  *
7  * You can't use, modify or distribute any part of this file without
8  * the explicit written agreements of Digital Barriers.
9  */
10 
15 #pragma once
16 #include <PClassifierInfo.h>
17 #include <PObject.h>
18 #include <PVector.h>
19 
20 PAPILLON_BEGIN_NAMESPACE
21 
22 class PDescription;
23 
40 class PAPILLON_API_CORE PFaceMetaData : public PObject {
41  public:
45  enum
46  PAPILLON_DEPRECATED("This functionality will be removed in Papillon 5")
47  EGenderType { E_GENDER_UNKNOWN = -1, E_GENDER_FEMALE = 0, E_GENDER_MALE = 1 };
48 
55  PFaceMetaData();
56 
60  PAPILLON_SUPPRESS_DEPRECATED_START
61  PAPILLON_DEPRECATED("Use PFaceMetaData::SetClassification. This functionality will be removed in Papillon 5")
62  PFaceMetaData(EGenderType gender, double genderConfidence);
63  PAPILLON_SUPPRESS_DEPRECATED_END
64 
68  PFaceMetaData(const PFaceMetaData& other);
69 
73  static PFaceMetaData FromDescription(const PDescription& description);
74 
78  ~PFaceMetaData() override;
79 
83  PFaceMetaData& operator=(const PFaceMetaData& other);
84 
88  bool operator==(const PFaceMetaData& other) const;
89 
93  void SetClassification(const PString& classificationName,
94  const PClassifierInfo& classifierInfo,
95  const PFloatVector& classificationVector,
96  int32 classIndex = -2,
97  float confidence = 0.f);
101  void SetClassification(const PString& classificationName,
102  const PClassifierInfo& classifierInfo,
103  int32 classIndex,
104  float confidence);
105 
109  PResult DeleteClassification(const PString& classificationName);
110 
114  PStringList GetClassificationNames() const;
115 
119  PResult GetClassifierInfo(const PString& classificationName, PClassifierInfo& classifierInfo) const;
120 
124  PResult GetClassIndex(const PString& classificationName, int32& classIndex) const;
125 
129  PResult GetClassIndex(const PString& classificationName, int32& classIndex, float& confidence) const;
130 
134  PResult GetClassLabel(const PString& classificationName, PString& classLabel) const;
135 
139  PResult GetClassLabel(const PString& classificationName, PString& classLabel, float& confidence) const;
140 
144  PResult GetClassConfidence(const PString& classificationName, float& confidence) const;
145 
149  PResult GetClassificationVector(const PString& classificationName, PFloatVector& classificationVector) const;
150 
154  PAPILLON_SUPPRESS_DEPRECATED_START
155  PAPILLON_DEPRECATED("Use PFaceMetaData::GetClassification. This functionality will be removed in Papillon 5")
156  EGenderType GetGender() const;
157  PAPILLON_SUPPRESS_DEPRECATED_END
158 
162  PAPILLON_DEPRECATED("Use PFaceMetaData::GetClassification. This functionality will be removed in Papillon 5")
163  PString GetGenderAsString() const;
164 
168  PAPILLON_DEPRECATED("Use PFaceMetaData::GetClassification. This functionality will be removed in Papillon 5")
169  double GetGenderConfidence() const;
170 
174  PAPILLON_DEPRECATED("This functionality will be removed in Papillon 5")
175  PString ToStringOSD() const;
176 
180  PString ToJSON() const;
181 };
182 
183 PAPILLON_END_NAMESPACE
Class PVector: a numeric vector for linear algebra.
EGenderType
The different genders available (deprecated)
Definition: PFaceMetaData.h:45
The PClassifierInfo class holds information about classifier and designed for conversion between clas...
Class PClassifierInfo: a class holding information about a classifier.
The PString class provides an Unicode character strings.
Definition: PString.h:37
The PDescription class represents a set of features that have been computed on an identity (it is a b...
Definition: PDescription.h:59
The PResult class represents the result returned by most of Papillon functions; this class is used to...
Definition: PResult.h:159
The PFaceMetaData class represents meta-data information (for example, gender) about a face...
Definition: PFaceMetaData.h:40
The PObject class is the root class of all Papillon classes; all PObject behaves like shared referenc...
Definition: PObject.h:27
The PStringList class represents a list of PString; NOT thread-safe.
Definition: PStringList.h:26
Class PObject: the root class of all Papillon classes.
PObject & operator=(const PObject &obj)
Performs a shared copy of other to this object.
Definition: PObject.h:45
Dense numeric vector (templated) used for linear algebra; specialised versions are PIntVector...
Definition: PVector.h:29