Hi how close the streaming with key like
if cv2.waitKey(25) & 0xFF==ord('q'):
break
i want to close this stream while hit a button
import jetson.inference
import jetson.utils
import time
net = jetson.inference.detectNet("ssd-mobilenet-v2", threshold=0.5)
camera = jetson.utils.videoSource("/dev/video1") # '/dev/video0' for V4L2
display = jetson.utils.videoOutput("") # '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()))
when import cv2 to Streaming code that @dusty_nv share, it doesn’t run