Jetson.utils not displaying camera image

I recently loaded the Jetson.Inference modules on Nano with Jetpack 4.5. I created a simple object identify program to see if it was working and when I run it, I get a scrolling text with references to Tactic: with numbers. I don’t see any camera display.
The code is:
import jetson.utils
import jetson.inference

cam=jetson.utils.gstCamera(640,480,’/dev/video0’)
disp=jetson.utils.glDisplay()
font=jetson.utils.cudaFont()
net=jetson.inference.imageNet(‘googlenet’)

while disp.IsOpen():
frame, width, height = cam.CaptureRGBA()
classID, confident = netClassify(frame, width, height)
item = net.GetClassDesc(classID)
font.OverlayText(frame. width, height, item)
disp.RenderOnce(frame, width, height)

Can you tell me what I left off or what needs correcting so I can display camera image?
Thank you very much Brian

Hi,
Please share information about the camera:

$ v4l2-ctl -d /dev/videoX --list-formats-ext

Hi @briansandy37, it is normal the first time you load a particular model, TensorRT will take some time to perform optimizations on the model to get better performance. When you see the references to Tactic: in the log, it is profiling different kernels and picking the fastest one. So just let it run until it completes. It will save the optimized model so it doesn’t need to do those optimizations every time (only the first time you load a model)

If you want to test your camera without loading a DNN model, then use the video-viewer tool.

Thanks for the response. Yesterday, I let the program run for several minutes and then the program suddenly stopped; without ever displaying the camera. This morning, without changing anything, I ran the program again. This time it starts for a brief moment; data streaming no display. And then the green light on the camera flashes for a second followed by the program stopping. Attached is the data on the camera I’m using. I’ve used this camera on several other programs with OpenCV.

Thanks Brian

Update: I discovered an error in my “confident” line of code. One letter off. That was what was causing the program to stop after the camera tried to open.
Corrected the error and the code is working.

Thank you very much for all your help!!
Brian

1 Like