I have been playing with Dusty’s tutorial code (from github) on my new Xavier NX, but I’m running into some performance issues.
Essentially I’m using this code:
import jetson.inference
import jetson.utils
net = jetson.inference.detectNet("ssd-mobilenet-v2", threshold=0.5)
camera = jetson.utils.videoSource("csi://0") # '/dev/video0' for V4L2
display = jetson.utils.videoOutput("display://0") # 'my_video.mp4' for file
while display.IsStreaming():
img = camera.Capture()
detections = net.Detect(img)
display.Render(img)
display.SetStatus("Object Detection | Network {:.0f} FPS".format(net.GetNetworkFPS()))
With an h264 encoded video as input and display://0 as output. The video is 1920x1080 pixels and 2000kbps bitrate, 25fps, no audio. SMPlayer plays this video easily with plenty CPU/GPU power to spare. But when I run object detection on it, the video clearly stutters. Whereas the FPS in the statusbar varies somewhere between 80 and even 120fps which seems to indicate the Jetson could theoretically be able to do 4 or even 5 of these streams at once. But it already stutters with one? I would like to have smooth playback and I assume the device should be able to. What am I doing wrong here?
It can’t be an I/O bottleneck I think, because the video is loaded from an NVMe SSD.