Hi,
I am trying to build jetson-inference from source on my Jetson Nano using a combination of these tutorials:
(Won’t let me post a link for some reason) On YouTube title name: " Real-Time Object Detection in 10 Lines of Python Code on Jetson Nano"
On GitHub: used dusty-nv’s jetson-inference page, page used is located on the “detectnet-example-2.md” page.
I’ve tried running the demo at the end of the YouTube video by running “python3 my-detection.py” , which gives me a looping error:
[gstreamer] gstCamera::Capture() – a timeout occurred waiting for the next image buffer
Additionally I tried running the command at 9:17 of the video which is “./detectnet-console.py images/peds_0.jpg output_0.jpg” . The issue is that detectnet-console.py will not install to the bin folder in my installation, and even when running from bin (where the file should be) I get this error:
bash: ./detectnet-console.py: No such file or directory
How can I run the my-detection file as well as properly install detectnet-console.py? In case it matters I am using a Logitech C270 HD Webcam in the chance that it’s a camera issue. Thanks in advance for any help/advice.
Below is the code for my-detection.py
#!/usr/bin/env python3
#
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
from jetson_inference import detectNet
from jetson_utils import videoSource, videoOutput
net = detectNet("ssd-mobilenet-v2", threshold=0.5)
camera = videoSource("csi://0") # '/dev/video0' for V4L2
display = videoOutput("display://0") # 'my_video.mp4' for file
while display.IsStreaming():
img = camera.Capture()
if img is None: # capture timeout
continue
detections = net.Detect(img)
display.Render(img)
display.SetStatus("Object Detection | Network {:.0f} FPS".format(net.GetNetworkFPS()))```