Fix ANSONNXYOLO:

1. core/ANSLicensingSystem/ANSLicense.h:268 — added default initializers to ModelConfig POD members (inpWidth = 0, inpHeight = 0, etc.). This was the actual bug: CreateANSODHandle declares a local ModelConfig and only sets a few fields, leaving inpWidth/inpHeight as indeterminate stack memory. On your machine that memory consistently held ~80, slipping past the <=0 → 640 guard and driving the ORT session at 80×80 — which crashes YOLOv11's /model.12/Concat because 2·ceil(80/32)=6 ≠ ceil(80/16)=5.

2. modules/ANSODEngine/ANSONNXYOLO.h:75 — ONNXYOLO::setInputShape() now snaps width/height up to the next multiple of 32 (with a 64-pixel floor). Defense in depth: even if a future caller hands in a non-stride-32 size, the FPN concat alignment is preserved.

3. modules/ANSODEngine/ANSONNXYOLO.cpp — two diagnostic additions:

WarmUpEngine bails with a clear log line if the warm-up dims aren't a multiple of 32, instead of letting the model.12 error fire and mask the real cause.
transform() logs the input shape, canvas shape, source size, and dynamic flag once per session in DebugView — so any future shape-mismatch crash points at the offending HxW directly.
This commit is contained in:
2026-05-01 20:24:08 +10:00
parent 1c8abf2a88
commit fc9cf9671b
4 changed files with 80 additions and 16 deletions
@@ -1858,8 +1858,19 @@ int FireNSmokeTest() {
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";
std::string imageFile = "E:\\Programs\\DemoAssets\\ALPR_Test\\Data Test\\pl_ocr_3264.jpg";
ImageDetectionEngine(onnmodelFilePath, imageFile, modelType);//yolov8
return 0;
}
int main()
{
ALPROD_Test();
//FireNSmokeTest();
//ElasticGPUTest();
@@ -1872,7 +1883,7 @@ int main()
//YOLO26OBBYolo11Test();
//SAM3ONNX_ImageTest(); // ORT reference — runs first, prints decoder input stats
//SAM3TRT_ImageTest(); // TRT under test — compare decoder input stats with above
CustomModel_StressTest_FilePlayer(); // Multi-task stress test (LabVIEW flow)
//CustomModel_StressTest_FilePlayer(); // Multi-task stress test (LabVIEW flow)
// CustomModel_SingleStream_FilePlayer(); // 1 cam + 1 task — isolates concurrency from per-instance bugs
//SAM3TRT_UnitTest(); // TensorRT SAM3 test (in ANSSAM3-UnitTest.cpp)
//TensorRT10Test();