Image recognition jetson nano

I’m trying to run image recognition on the jetson nano with Rasberry pi v2 cam.

py code:

import jetson.inference
import jetson.utils
import time
width=1280
height=720
cam=jetson.utils.gstCamera(width, height, '0')
disp=jetson.utils.glDisplay()
font=jetson.utils.cudaFont()
net=jetson.inference.imageNet('googlenet')
timeMark=time.time()
fpsFilter=0

while disp.IsOpen():
    frame, width, height=cam.CaptureRGBA()
    classID, confiden=net.Classify(frame, width, height)
    item=net.GetClassDesc(classID)
    dt=time.time()-timeMark
    fps=1/dt
    fpsFilter=.95*fpsFilter +.05*fpsFilter
    timeMark=time.time()
    font.OverlayText(frame, width, height, str(round(fpsFilter,1))+' fps '+item,5,5,font.Magenta,font.Blue)
    disp.RenderOnce(frame, width, height)

I get these errors when running program

nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
nvbuf_utils: can not get HW buffer from FD... Exiting...

Hi @maxlof97 , are you first able to get a video feed from your camera by running nvgstcapture-1.0?

Also, you may wish to update your jetson-inference install and/or code. See the more recent version of imagenet program here:

You can also run it inside container now, so you don’t have to build the project from source if you don’t want to. There is also a video-viewer tool that you can use to test the camera from the jetson-inference side before you try the recognition. I would recommend first trying nvgstcapture-1.0, then video-viewer, then recognition.