This is an example of how to handle Classification's error code. More details about this example.
#include <iostream>
#include <string>
int SRErrorReturnCode = -1;
#define CheckSRClsErrors(status, handle, testResult)\
{ \
eErrorType e = status; \
if (e != NO_ERROR_OUT) \
{ \
PrintErrorType(e); \
SR_DestroyClsTestHandle(handle); \
SR_DeleteClsTestResult(testResult); \
return SRErrorReturnCode; \
} \
}
int main()
{
std::wstring data_dir = L"../../../examples/data";
std::wstring model_path = data_dir + L"/models/textile_sample_model.srCls";
if (handle == nullptr)
{
std::cerr << "SaigeVision Classification Error: invalid file path" << std::endl;
std::cin.get();
return -1;
}
int gpu_index = -1;
std::cout << "SaigeVision successfully completed, please press enter key to terminate" << std::endl;
std::cin.get();
return 0;
}