ImageNet classifies correctly still images but not video stream

I’m facing the following problem: I trained resnet-18 to recognize two clearly distinctable classes. Tested that recognition works well with still images. But when it fed from video stream, classification is totally incorrect.

More details:
I captured video of two situations, and then extracted still images from this video to describe two classes. Prepared datasets from these.
Trained resnet-18 on Jetson Orin Nano, and converted to ONNX format.
Tested the results with imageNet on series of still images, taken from the same video. Everything was perfect.
Set imageNet to receve video input from the same camera (/dev/video0). It is running, the video is the same as for train set used before, but classification results are totally incorrect. Clearly the network doesn’t see the same images as it was trained for.
I experimented with the frame rate, video width and high. It did not help.
I also recorded camera content to MP4 file and fed it as input to imageNet instead of camera stream. MP4 resolution is very close to resolution of images in dataset. It did not change, classification still fails.

I will be grateful for any ideas what can be wrong.
Thanks !

Hi,

Which source do you use? Is it jetson-inference?
If so, which camera library/SDK do you use? OpenCV or jetson-utils?

Thanks

Yes, I’m using jetson-inference. I’m running ImageNet utility from command line. It was built with JetPack 6 according to instructions -
jetson-inference/docs/building-repo-2.md at master · dusty-nv/jetson-inference · GitHub
I beleive that build is based on jetson-utils for camera library

I think this is resolved. Still images and dataset were taken under different lighting than live video. It makes the difference. The issue is not related to using camera versus still images. It was misunderstanding.
Sorry for confusion and thank you for help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.