Fix onnx runtime loader for custom model

This commit is contained in:
2026-05-05 16:23:01 +10:00
parent b0002b4a4b
commit 66c67dff26
3 changed files with 64 additions and 12 deletions
@@ -1835,14 +1835,11 @@ int ElasticGPUTest() {
}
int FireNSmokeTest() {
int FireNSmokeGetCofigurationTest() {
int modelType = 16; // Custom model type for helmet detection, adjust as needed based on how the model is set up in the engine
std::string modelFilePath = "C:\\Projects\\ANSVIS\\Models\\ANS_FireSmoke_v2.0.zip";
std::string videoFile = "E:\\Programs\\DemoAssets\\Videos\\Helmet\\HM1.mp4";
ANSCENTER::ANSODBase* infHandle;
std::string licenseKey = "";
std::string modelZipFilePassword = "";
double detectionScoreThreshold = 0.3;
@@ -1851,18 +1848,15 @@ int FireNSmokeTest() {
int loadEngine = 0;
CreateANSODHandle(&infHandle, licenseKey.c_str(), modelFilePath.c_str(), modelZipFilePassword.c_str(),
detectionScoreThreshold, modelConfThreshold, modelNMSThreshold, 1, modelType, 1, loadEngine);
std::string stParam;
GetConfiguredParameters_CPP(&infHandle, stParam);
std::cout << "Configured parameters:\n" << stParam << std::endl;
ReleaseANSODHandle(&infHandle);
return 0;
}
int ALPROD_Test() {
int modelType = 30; // ONNX YOLO (30) RT YOLO (31)
std::string onnmodelFilePath = "E:\\Programs\\DemoAssets\\ALPR_Test\\ANS_ALPR_2204(GPU)_1.zip";
@@ -1870,10 +1864,19 @@ int ALPROD_Test() {
ImageDetectionEngine(onnmodelFilePath, imageFile, modelType);//yolov8
return 0;
}
int FallDetectorTest() {
int modelType = 16; // Custom model type for helmet detection, adjust as needed based on how the model is set up in the engine
std::string modelFilePath = "E:\\Programs\\CustomModelDev\\ANSFallDetector_v1.0.zip";
std::string videoFile = "E:\\Programs\\DemoAssets\\Videos\\Fall\\video3.mp4";
VideoDetectorEngine(modelFilePath, videoFile, modelType);
return 0;
}
int main()
{
ALPROD_Test();
FallDetectorTest();
//ALPROD_Test();
//FireNSmokeTest();
//ElasticGPUTest();