![]() |
Face Engine SDK
5.25.0
A face detection, recognition and tracking engine.
|
00001 00008 #pragma once 00009 00010 #include <fsdk/Types/Result.h> 00011 00012 namespace fsdk { 00013 00017 enum class FSDKError : uint32_t { 00018 Ok, 00019 Internal, 00020 InvalidInput, 00021 InvalidImage, 00022 00023 InvalidRect, 00024 InvalidImageFormat, 00025 InvalidImageSize, 00026 InvalidDetection, 00027 InvalidLandmarks5, 00028 InvalidLandmarks68, 00029 InvalidTransformation, 00030 InvalidDescriptor, 00031 InvalidDescriptorBatch, 00032 InvalidSettingsProvider, 00033 InvalidDescriptorId, 00034 InvalidPath, 00035 InvalidSerializedObject, 00036 00037 ModuleNotInitialized, 00038 ModuleNotReady, 00039 LicenseError, 00040 00041 BufferIsNull, 00042 BufferIsFull, 00043 BufferIsEmpty, 00044 InvalidBufferSize, 00045 InvalidSpanSize, 00046 InvalidBatch, 00047 00048 IncompatibleDescriptors, 00049 EnableJustInBetaMode, 00050 00051 FiltredAggregationError, 00052 00053 BatchedInternalError, 00054 00055 UnsupportedFunctionality, // !< was requested unsupported functionality for this type of descroptor or for 00056 // this model version 00057 00058 HighMemoryUsage, // !< Operation required a lot of memory. Batch size if too big for example. 00059 00060 IncompatibleModelVersions, 00061 ModelNotLoaded, 00062 InvalidConfig, 00063 LicenseIsNotActivated, 00064 LicenseActivationLimitExceeded, 00065 FeatureNotAvailable, 00066 FeatureExpired, 00067 FingerprintError, 00068 ValidationFailed, 00069 CudaError, 00070 00071 NotImplemented, 00072 }; 00073 00077 template <> 00078 struct ErrorTraits<FSDKError> { 00079 00080 static bool isOk(FSDKError error) noexcept { 00081 return error == FSDKError::Ok; 00082 } 00083 00084 static const char* toString(FSDKError error) noexcept { 00085 switch(error) { 00086 case FSDKError::Ok: 00087 return "Ok"; 00088 case FSDKError::Internal: 00089 return "Internal error"; 00090 case FSDKError::InvalidInput: 00091 return "Invalid input"; 00092 case FSDKError::InvalidImage: 00093 return "Invalid image"; 00094 case FSDKError::InvalidRect: 00095 return "Invalid rectangle"; 00096 case FSDKError::InvalidImageFormat: 00097 return "Invalid image format"; 00098 case FSDKError::InvalidImageSize: 00099 return "Invalid image size"; 00100 case FSDKError::InvalidDetection: 00101 return "Invalid detection"; 00102 case FSDKError::InvalidLandmarks5: 00103 return "Invalid landmarks 5"; 00104 case FSDKError::InvalidLandmarks68: 00105 return "Invalid landmarks 68"; 00106 case FSDKError::InvalidTransformation: 00107 return "Invalid transformation."; 00108 case FSDKError::InvalidDescriptor: 00109 return "Invalid descriptor"; 00110 case FSDKError::InvalidDescriptorBatch: 00111 return "Invalid descriptor batch."; 00112 case FSDKError::InvalidSettingsProvider: 00113 return "Invalid settings provider.."; 00114 case FSDKError::InvalidDescriptorId: 00115 return "Invalid descriptor id."; 00116 case FSDKError::InvalidPath: 00117 return "Invalid path."; 00118 case FSDKError::InvalidSerializedObject: 00119 return "Invalid serialized object."; 00120 case FSDKError::ModuleNotInitialized: 00121 return "Module is not initialized"; 00122 case FSDKError::ModuleNotReady: 00123 return "Module is not ready"; 00124 case FSDKError::LicenseError: 00125 return "Licensing issue"; 00126 case FSDKError::BufferIsNull: 00127 return "Buffer is null"; 00128 case FSDKError::BufferIsFull: 00129 return "Buffer is full"; 00130 case FSDKError::BufferIsEmpty: 00131 return "Buffer is empty"; 00132 case FSDKError::InvalidBufferSize: 00133 return "Invalid buffer size"; 00134 case FSDKError::InvalidSpanSize: 00135 return "Invalid span size"; 00136 case FSDKError::InvalidBatch: 00137 return "Invalid Batch"; 00138 case FSDKError::IncompatibleDescriptors: 00139 return "Descriptors are incompatible"; 00140 case FSDKError::EnableJustInBetaMode: 00141 return "Attempt to create feature while betaMode is turned off"; 00142 case FSDKError::FiltredAggregationError: 00143 return "Cant aggregate descriptors - all images'a GSs are less the threashold"; 00144 case FSDKError::BatchedInternalError: 00145 return "Something gone wrong in batched query"; 00146 case FSDKError::UnsupportedFunctionality: 00147 return "Was requested unsupported functionality"; 00148 case FSDKError::HighMemoryUsage: 00149 return "Operation required a lot of memory"; 00150 case FSDKError::IncompatibleModelVersions: 00151 return "Incompatible model versions"; 00152 case FSDKError::ModelNotLoaded: 00153 return "Model not loaded"; 00154 case FSDKError::InvalidConfig: 00155 return "Invalid config"; 00156 case FSDKError::LicenseIsNotActivated: 00157 return "License is not activated!"; 00158 case FSDKError::LicenseActivationLimitExceeded: 00159 return "License activation limit exceeded."; 00160 case FSDKError::FeatureNotAvailable: 00161 return "Requested Feature not available."; 00162 case FSDKError::FeatureExpired: 00163 return "Feature is expired."; 00164 case FSDKError::FingerprintError: 00165 return "Failed to get device fingerprint."; 00166 case FSDKError::ValidationFailed: 00167 return "Failed validation."; 00168 case FSDKError::CudaError: 00169 return "CUDA Error"; 00170 case FSDKError::NotImplemented: 00171 return "Not implemented."; 00172 default: 00173 return "Unknown error"; 00174 } 00175 } 00176 }; 00177 00178 } // namespace fsdk