This is an example of how to handle det's error code. More details about this example.
#include <iostream>
#include <string>
int SRErrorReturnCode = -1;
#define CheckSRDetErrors(status, handle, testResult)\
{ \
eErrorType e = status; \
if (e != NO_ERROR_OUT) \
{ \
PrintErrorType(e); \
SR_DestroyDetTestHandle(handle); \
SR_DeleteDetTestResult(testResult); \
return SRErrorReturnCode; \
} \
}
int main()
{
std::wstring data_dir = L"../../../examples/data";
std::wstring model_path = data_dir + L"/models/lego_sample_model.srDet";
{
std::cerr << "SaigeVision Detection 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;
}
Header file for Detection Module.
eErrorType SR_CreateDetTestHandleByWideCharPath_ErrorType(DetTestHandle *detTestHandle, const wchar_t *filePath)
Create a DetTestHandle via wide char path.
void * DetTestHandle
Detection file handler.
Definition: DetectorTestDLL.h:52
eErrorType SR_DestroyDetTestHandle(DetTestHandle handle)
Destruct a DetTestHandle.
eErrorType SR_LoadDetTestNetworkInGPU(DetTestHandle handle, int GPUNumber)
Allocate required cpu & gpu memory.