test(ANSODEngine): let the harness run a model this machine actually has
Every test in that file names a model and a video from whichever workstation it was written on, so anywhere else the harness prints "Model zip file is not exist" and exits before it reaches the GPU. That is what happened on the machine that is meant to be testing CUDA and TensorRT. Given a model and a video on the command line it runs those instead, with an optional engine type and detection type. With no arguments it behaves exactly as before, so nobody's workflow changes. The model may be a .zip or a sealed .ansmodel, because the engine now opens either — and that is the only way to watch a sealed model run on a GPU, which is the last thing in this format that has never been seen working end to end. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
#include "ANSCUSTOMPY.h"
|
#include "ANSCUSTOMPY.h"
|
||||||
#include "ANSMotionDetector.h"
|
#include "ANSMotionDetector.h"
|
||||||
#include "ANSONNXSAM3.h"
|
#include "ANSONNXSAM3.h"
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <iostream>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@@ -2235,8 +2237,31 @@ int FireNSmokeTest() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
// RUN A MODEL THIS MACHINE ACTUALLY HAS. Every test below names a path from
|
||||||
|
// whichever workstation it was written on, so on any other machine the harness
|
||||||
|
// stops at "Model zip file is not exist" before it ever reaches the GPU. Given
|
||||||
|
// arguments it runs what it is told instead:
|
||||||
|
//
|
||||||
|
// ANSODEngine-UnitTest.exe <model> <video> [engineType] [detectionType]
|
||||||
|
//
|
||||||
|
// `model` is a .zip or a sealed .ansmodel — the engine opens either, and a
|
||||||
|
// package is the only way to see a sealed model run on the GPU. engineType is
|
||||||
|
// the ModelType enum (3 auto-detects a YOLO export, 30 ONNX YOLO, 16 custom,
|
||||||
|
// 32 RTMPose); detectionType 1 is object detection.
|
||||||
|
//
|
||||||
|
// With no arguments it does exactly what it did before.
|
||||||
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
if (argc >= 3) {
|
||||||
|
const std::string model = argv[1];
|
||||||
|
const std::string video = argv[2];
|
||||||
|
const int engineType = (argc > 3) ? std::atoi(argv[3]) : 3;
|
||||||
|
const int detectionType = (argc > 4) ? std::atoi(argv[4]) : 1;
|
||||||
|
std::cout << "model: " << model << "\nvideo: " << video
|
||||||
|
<< "\nengineType: " << engineType
|
||||||
|
<< ", detectionType: " << detectionType << std::endl;
|
||||||
|
return VideoDetectorEngine_CPP(model, video, engineType, detectionType);
|
||||||
|
}
|
||||||
|
|
||||||
//FallDetectorTest();
|
//FallDetectorTest();
|
||||||
//ALPROD_Test();
|
//ALPROD_Test();
|
||||||
|
|||||||
Reference in New Issue
Block a user