Face Engine SDK  5.21.0
A face detection, recognition and tracking engine.
FSDKError.h
Go to the documentation of this file.
1 
8 #pragma once
9 
10 #include <fsdk/Types/Result.h>
11 
12 namespace fsdk {
13 
17  enum class FSDKError : uint32_t {
18  Ok,
19  Internal,
20  InvalidInput,
21  InvalidImage,
22 
23  InvalidRect,
24  InvalidImageFormat,
25  InvalidImageSize,
26  InvalidDetection,
27  InvalidLandmarks5,
28  InvalidLandmarks68,
29  InvalidTransformation,
30  InvalidDescriptor,
31  InvalidDescriptorBatch,
32  InvalidSettingsProvider,
33  InvalidDescriptorId,
34  InvalidPath,
35  InvalidSerializedObject,
36 
37  ModuleNotInitialized,
38  ModuleNotReady,
39  LicenseError,
40 
41  BufferIsNull,
42  BufferIsFull,
43  BufferIsEmpty,
44  InvalidBufferSize,
45  InvalidSpanSize,
46  InvalidBatch,
47 
48  IncompatibleDescriptors,
49  EnableJustInBetaMode,
50 
51  FiltredAggregationError,
52 
53  BatchedInternalError,
54  UnsupportedFunctionality, // !< was requested unsupported functionality for this type of descroptor or for
56  // this model version
57 
58  HighMemoryUsage, // !< Operation required a lot of memory. Batch size if too big for example.
59 
60  IncompatibleModelVersions,
61  ModelNotLoaded,
62  InvalidConfig,
63  LicenseIsNotActivated,
64  FeatureNotAvailable,
65  FeatureExpired,
66  FingerprintError,
67  ValidationFailed,
68  CudaError,
69 
71  };
72 
76  template <>
78 
79  static bool isOk(FSDKError error) noexcept {
80  return error == FSDKError::Ok;
81  }
82 
83  static const char* toString(FSDKError error) noexcept {
84  switch(error) {
85  case FSDKError::Ok:
86  return "Ok";
88  return "Internal error";
90  return "Invalid input";
92  return "Invalid image";
93  case FSDKError::InvalidRect:
94  return "Invalid rectangle";
95  case FSDKError::InvalidImageFormat:
96  return "Invalid image format";
97  case FSDKError::InvalidImageSize:
98  return "Invalid image size";
99  case FSDKError::InvalidDetection:
100  return "Invalid detection";
101  case FSDKError::InvalidLandmarks5:
102  return "Invalid landmarks 5";
103  case FSDKError::InvalidLandmarks68:
104  return "Invalid landmarks 68";
105  case FSDKError::InvalidTransformation:
106  return "Invalid transformation.";
107  case FSDKError::InvalidDescriptor:
108  return "Invalid descriptor";
109  case FSDKError::InvalidDescriptorBatch:
110  return "Invalid descriptor batch.";
111  case FSDKError::InvalidSettingsProvider:
112  return "Invalid settings provider..";
113  case FSDKError::InvalidDescriptorId:
114  return "Invalid descriptor id.";
116  return "Invalid path.";
117  case FSDKError::InvalidSerializedObject:
118  return "Invalid serialized object.";
119  case FSDKError::ModuleNotInitialized:
120  return "Module is not initialized";
121  case FSDKError::ModuleNotReady:
122  return "Module is not ready";
123  case FSDKError::LicenseError:
124  return "Licensing issue";
125  case FSDKError::BufferIsNull:
126  return "Buffer is null";
127  case FSDKError::BufferIsFull:
128  return "Buffer is full";
129  case FSDKError::BufferIsEmpty:
130  return "Buffer is empty";
131  case FSDKError::InvalidBufferSize:
132  return "Invalid buffer size";
133  case FSDKError::InvalidSpanSize:
134  return "Invalid span size";
135  case FSDKError::InvalidBatch:
136  return "Invalid Batch";
137  case FSDKError::IncompatibleDescriptors:
138  return "Descriptors are incompatible";
139  case FSDKError::EnableJustInBetaMode:
140  return "Attempt to create feature while betaMode is turned off";
141  case FSDKError::FiltredAggregationError:
142  return "Cant aggregate descriptors - all images'a GSs are less the threashold";
143  case FSDKError::BatchedInternalError:
144  return "Something gone wrong in batched query";
145  case FSDKError::UnsupportedFunctionality:
146  return "Was requested unsupported functionality";
147  case FSDKError::HighMemoryUsage:
148  return "Operation required a lot of memory";
149  case FSDKError::IncompatibleModelVersions:
150  return "Incompatible model versions";
151  case FSDKError::ModelNotLoaded:
152  return "Model not loaded";
153  case FSDKError::InvalidConfig:
154  return "Invalid config";
155  case FSDKError::LicenseIsNotActivated:
156  return "License is not activated!";
157  case FSDKError::FeatureNotAvailable:
158  return "Requested Feature not available.";
159  case FSDKError::FeatureExpired:
160  return "Feature is expired.";
161  case FSDKError::FingerprintError:
162  return "Failed to get device fingerprint.";
163  case FSDKError::ValidationFailed:
164  return "Failed validation.";
165  case FSDKError::CudaError:
166  return "CUDA Error";
168  return "Not implemented.";
169  default:
170  return "Unknown error";
171  }
172  }
173  };
174 
175 } // namespace fsdk
fsdk::FSDKError::InvalidInput
@ InvalidInput
Invalid input.
fsdk::FSDKError
FSDKError
Common SDK error codes.
Definition: FSDKError.h:17
fsdk::FSDKError::Internal
@ Internal
Internal error.
fsdk::FSDKError::InvalidPath
@ InvalidPath
Invalid path to object.
fsdk
SDK namespace.
Definition: IAGSEstimator.h:8
fsdk::FSDKError::Ok
@ Ok
Ok.
fsdk::ErrorTraits
Definition: Result.h:8
fsdk::FSDKError::InvalidImage
@ InvalidImage
Invalid image.