Hello AI World - my-detection.py ( coding your own object Detection prog) error

Hi

Am trying to run my-detection.py as per below example, using CSI Camera

import jetson.inference
import jetson.utils

net = jetson.inference.detectNet(“ssd-mobilenet-v2”, threshold=0.5)
camera = jetson.utils.gstCamera(1280, 720, “0”)
display = jetson.utils.glDisplay()

while display.IsOpen():
img, width, height = camera.CaptureRGBA()
detections = net.Detect(img, width, height)
display.RenderOnce(img, width, height)
display.SetTitle(“Object Detection | Network {:.0f} FPS”.format(net.GetNetworkFPS())


The image opens but immediately the camera closes with below message :

ATTRIBUTE ERROR : JETSON.INFERENCE.DETECTNET- OBJECT HAS NO ATTRIBUTE “GETNETWORK…”

LAST LINE
POWERSERVICEHWVIC::CLEANUPRESOURCES

KINDLY SUGGEST - THANKS

Hi,

I think issue is due to detectNet initialization.

To load the object detection network

net = jetson.inference.detectNet(opt.network, sys.argv, opt.threshold)

Please refer below API link for more details:
https://rawgit.com/dusty-nv/jetson-inference/python/docs/html/python/jetson.inference.html#detectNet

Also, please check below example for your refernce:
https://github.com/dusty-nv/jetson-inference/blob/master/python/examples/detectnet-camera.py

Thanks