Face Engine SDK  5.23.1
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  LicenseActivationLimitExceeded,
65  FeatureNotAvailable,
66  FeatureExpired,
67  FingerprintError,
68  ValidationFailed,
69  CudaError,
70 
72  };
73 
77  template <>
79 
80  static bool isOk(FSDKError error) noexcept {
81  return error == FSDKError::Ok;
82  }
83 
84  static const char* toString(FSDKError error) noexcept {
85  switch(error) {
86  case FSDKError::Ok:
87  return "Ok";
89  return "Internal error";
91  return "Invalid input";
93  return "Invalid image";
94  case FSDKError::InvalidRect:
95  return "Invalid rectangle";
96  case FSDKError::InvalidImageFormat:
97  return "Invalid image format";
98  case FSDKError::InvalidImageSize:
99  return "Invalid image size";
100  case FSDKError::InvalidDetection:
101  return "Invalid detection";
102  case FSDKError::InvalidLandmarks5:
103  return "Invalid landmarks 5";
104  case FSDKError::InvalidLandmarks68:
105  return "Invalid landmarks 68";
106  case FSDKError::InvalidTransformation:
107  return "Invalid transformation.";
108  case FSDKError::InvalidDescriptor:
109  return "Invalid descriptor";
110  case FSDKError::InvalidDescriptorBatch:
111  return "Invalid descriptor batch.";
112  case FSDKError::InvalidSettingsProvider:
113  return "Invalid settings provider..";
114  case FSDKError::InvalidDescriptorId:
115  return "Invalid descriptor id.";
117  return "Invalid path.";
118  case FSDKError::InvalidSerializedObject:
119  return "Invalid serialized object.";
120  case FSDKError::ModuleNotInitialized:
121  return "Module is not initialized";
122  case FSDKError::ModuleNotReady:
123  return "Module is not ready";
124  case FSDKError::LicenseError:
125  return "Licensing issue";
126  case FSDKError::BufferIsNull:
127  return "Buffer is null";
128  case FSDKError::BufferIsFull:
129  return "Buffer is full";
130  case FSDKError::BufferIsEmpty:
131  return "Buffer is empty";
132  case FSDKError::InvalidBufferSize:
133  return "Invalid buffer size";
134  case FSDKError::InvalidSpanSize:
135  return "Invalid span size";
136  case FSDKError::InvalidBatch:
137  return "Invalid Batch";
138  case FSDKError::IncompatibleDescriptors:
139  return "Descriptors are incompatible";
140  case FSDKError::EnableJustInBetaMode:
141  return "Attempt to create feature while betaMode is turned off";
142  case FSDKError::FiltredAggregationError:
143  return "Cant aggregate descriptors - all images'a GSs are less the threashold";
144  case FSDKError::BatchedInternalError:
145  return "Something gone wrong in batched query";
146  case FSDKError::UnsupportedFunctionality:
147  return "Was requested unsupported functionality";
148  case FSDKError::HighMemoryUsage:
149  return "Operation required a lot of memory";
150  case FSDKError::IncompatibleModelVersions:
151  return "Incompatible model versions";
152  case FSDKError::ModelNotLoaded:
153  return "Model not loaded";
154  case FSDKError::InvalidConfig:
155  return "Invalid config";
156  case FSDKError::LicenseIsNotActivated:
157  return "License is not activated!";
158  case FSDKError::LicenseActivationLimitExceeded:
159  return "License activation limit exceeded.";
160  case FSDKError::FeatureNotAvailable:
161  return "Requested Feature not available.";
162  case FSDKError::FeatureExpired:
163  return "Feature is expired.";
164  case FSDKError::FingerprintError:
165  return "Failed to get device fingerprint.";
166  case FSDKError::ValidationFailed:
167  return "Failed validation.";
168  case FSDKError::CudaError:
169  return "CUDA Error";
171  return "Not implemented.";
172  default:
173  return "Unknown error";
174  }
175  }
176  };
177 
178 } // 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.