How to trigger AI inference for X cycles

Hi all,

I would like to know whether it is possible to manually start image classification using the camera and stop it after it has run for X amount of times.

Thanks in advance for the help!

Hi @PingTKP ,

You may refer to the example here to trigger NN inference for X times. Kindly type “STARTNN” to start the inference, and it will stop after it has run for 50 times.

inference_limit_test.zip (1.9 KB)

Thank you.

Hi @KevinKL,

I am running the inference with Lens Distortion Correction enabled. Without starting the NN channel with Camera.channelBegin(CHANNELNN) and then enabling LDC with cam_config.setLDC(1). I get the following messages in the monitor.

VOE not init
VOE not init
VOE not init
VOE not init
VOE not init
VOE not init
VOE not init
VOE not init
VOE not init
VOE not init
[INFO] Len Distortion Correction is Enabled.

I would like to ask whether LDC is properly enabled?

As for now, I have found that I can use videoStreamerNN.pause() and videoStreamerNN.resume() to control when inference starts and stop without any weird messages in the monitor. Would this be a better way to control when inference starts and stop?

Thank you for the response!

Hi @PingTKP ,

Yes, you may continue to use videoStreamerNN.pause() and videoStreamerNN.resume() to control the starting and stopping of inference, it is a better way indeed. Regarding the LDC enabling issue, please only enable the LDC after calling Camera.channelBegin(CHANNELNN), the LDC is not properly enabled if “VOE not init” message is printed out upon calling cam_config.setLDC(1), you may use cam_config.getLDC() to verify the LDC enable status.

Thank you.