jetson-inference
jetson-inference copied to clipboard
How to use USB Camera in recognition
`imageNet -- loading classification network model from: -- prototxt networks/Googlenet/googlenet.prototxt -- model networks/Googlenet/bvlc_googlenet.caffemodel -- class_labels networks/ilsvrc12_synset_words.txt -- input_blob 'data' -- output_blob 'prob' -- batch_size 1
[TRT] TensorRT version 7.1.3
[TRT] loading NVIDIA plugins...
[TRT] Registered plugin creator - ::GridAnchor_TRT version 1
[TRT] Registered plugin creator - ::NMS_TRT version 1
[TRT] Registered plugin creator - ::Reorg_TRT version 1
[TRT] Registered plugin creator - ::Region_TRT version 1
[TRT] Registered plugin creator - ::Clip_TRT version 1
[TRT] Registered plugin creator - ::LReLU_TRT version 1
[TRT] Registered plugin creator - ::PriorBox_TRT version 1
[TRT] Registered plugin creator - ::Normalize_TRT version 1
[TRT] Registered plugin creator - ::RPROI_TRT version 1
[TRT] Registered plugin creator - ::BatchedNMS_TRT version 1
[TRT] Could not register plugin creator - ::FlattenConcat_TRT version 1
[TRT] Registered plugin creator - ::CropAndResize version 1
[TRT] Registered plugin creator - ::DetectionLayer_TRT version 1
[TRT] Registered plugin creator - ::Proposal version 1
[TRT] Registered plugin creator - ::ProposalLayer_TRT version 1
[TRT] Registered plugin creator - ::PyramidROIAlign_TRT version 1
[TRT] Registered plugin creator - ::ResizeNearest_TRT version 1
[TRT] Registered plugin creator - ::Split version 1
[TRT] Registered plugin creator - ::SpecialSlice_TRT version 1
[TRT] Registered plugin creator - ::InstanceNormalization_TRT version 1
[TRT] detected model format - caffe (extension '.caffemodel')
[TRT] desired precision specified for GPU: FASTEST
[TRT] requested fasted precision for device GPU without providing valid calibrator, disabling INT8
[TRT] native precisions detected for GPU: FP32, FP16, INT8
[TRT] selecting fastest native precision for GPU: FP16
[TRT] found engine cache file networks/Googlenet/bvlc_googlenet.caffemodel.1.1.7103.GPU.FP16.engine
[TRT] found model checksum networks/Googlenet/bvlc_googlenet.caffemodel.sha256sum
[TRT] echo "$(cat networks/Googlenet/bvlc_googlenet.caffemodel.sha256sum) networks/Googlenet/bvlc_googlenet.caffemodel" | sha256sum --check --status
[TRT] model matched checksum networks/Googlenet/bvlc_googlenet.caffemodel.sha256sum
[TRT] loading network plan from engine cache... networks/Googlenet/bvlc_googlenet.caffemodel.1.1.7103.GPU.FP16.engine
[TRT] device GPU, loaded networks/Googlenet/bvlc_googlenet.caffemodel
[TRT] Deserialize required 2929823 microseconds.
[TRT]
[TRT] CUDA engine context initialized on device GPU:
[TRT] -- layers 85
[TRT] -- maxBatchSize 1
[TRT] -- workspace 0
[TRT] -- deviceMemory 11307520
[TRT] -- bindings 2
[TRT] binding 0
-- index 0
-- name 'data'
-- type FP32
-- in/out INPUT
-- # dims 3
-- dim #0 3 (SPATIAL)
-- dim #1 224 (SPATIAL)
-- dim #2 224 (SPATIAL)
[TRT] binding 1
-- index 1
-- name 'prob'
-- type FP32
-- in/out OUTPUT
-- # dims 3
-- dim #0 1000 (SPATIAL)
-- dim #1 1 (SPATIAL)
-- dim #2 1 (SPATIAL)
[TRT]
[TRT] binding to input 0 data binding index: 0
[TRT] binding to input 0 data dims (b=1 c=3 h=224 w=224) size=602112
[TRT] binding to output 0 prob binding index: 1
[TRT] binding to output 0 prob dims (b=1 c=1000 h=1 w=1) size=4000
[TRT]
[TRT] device GPU, networks/Googlenet/bvlc_googlenet.caffemodel initialized.
[TRT] loaded 1000 class labels
[TRT] imageNet -- networks/Googlenet/bvlc_googlenet.caffemodel initialized.
[gstreamer] initialized gstreamer, version 1.14.5.0
[gstreamer] gstCamera -- attempting to create device csi://0
[gstreamer] gstCamera pipeline string:
[gstreamer] nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=30/1, format=(string)NV12 ! nvvidconv flip-method=2 ! video/x-raw(memory:NVMM) ! appsink name=mysink
[gstreamer] gstCamera successfully created device csi://0
[video] created gstCamera from csi://0
gstCamera video options:
-- URI: csi://0 - protocol: csi - location: 0 -- deviceType: csi -- ioType: input -- width: 1280 -- height: 720 -- frameRate: 30 -- numBuffers: 4 -- zeroCopy: true -- flipMethod: rotate-180
[OpenGL] glDisplay -- X screen 0 resolution: 1920x1080 [OpenGL] glDisplay -- X window resolution: 1920x1080 [OpenGL] glDisplay -- display device initialized (1920x1080) [video] created glDisplay from display://0
glDisplay video options:
-- URI: display://0 - protocol: display - location: 0 -- deviceType: display -- ioType: output -- width: 1920 -- height: 1080 -- frameRate: 0 -- numBuffers: 4 -- zeroCopy: true
[gstreamer] opening gstCamera for streaming, transitioning pipeline to GST_STATE_PLAYING [gstreamer] gstreamer changed state from NULL to READY ==> mysink [gstreamer] gstreamer changed state from NULL to READY ==> capsfilter1 [gstreamer] gstreamer changed state from NULL to READY ==> nvvconv0 [gstreamer] gstreamer changed state from NULL to READY ==> capsfilter0 [gstreamer] gstreamer changed state from NULL to READY ==> nvarguscamerasrc0 [gstreamer] gstreamer changed state from NULL to READY ==> pipeline0 [gstreamer] gstreamer changed state from READY to PAUSED ==> capsfilter1 [gstreamer] gstreamer changed state from READY to PAUSED ==> nvvconv0 [gstreamer] gstreamer changed state from READY to PAUSED ==> capsfilter0 [gstreamer] gstreamer stream status CREATE ==> src [gstreamer] gstreamer changed state from READY to PAUSED ==> nvarguscamerasrc0 [gstreamer] gstreamer changed state from READY to PAUSED ==> pipeline0 [gstreamer] gstreamer message new-clock ==> pipeline0 [gstreamer] gstreamer changed state from PAUSED to PLAYING ==> capsfilter1 [gstreamer] gstreamer stream status ENTER ==> src [gstreamer] gstreamer changed state from PAUSED to PLAYING ==> nvvconv0 [gstreamer] gstreamer changed state from PAUSED to PLAYING ==> capsfilter0 [gstreamer] gstreamer changed state from PAUSED to PLAYING ==> nvarguscamerasrc0 [gstreamer] gstreamer message stream-start ==> pipeline0 Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:557 No cameras available [gstreamer] gstCamera -- end of stream (EOS) [gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer [gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer [gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer [gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer [gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer [gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer [gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer [gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer [gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer [gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer [gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer [gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer [gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer
`
For study Running the Live Camera Recognition Demo, I plugged a USB camera into the jetson Xavier NX board and ran . /imagenet.py csi://0
without the expected results. But as you can see from the output on the command line, the video stream has been created.
For study Running the Live Camera Recognition Demo, I plugged a USB camera into the jetson Xavier NX board and ran
. /imagenet.py csi://0
without the expected results. But as you can see from the output on the command line, the video stream has been created.
@WangQingchen123 csi://0
is for using MIPI CSI camera, for USB camera you would start it with something like /dev/video0
For more info, see here: https://github.com/dusty-nv/jetson-inference/blob/master/docs/aux-streaming.md#v4l2-cameras
I have the same problem and I did try ./imagenet.py /dev/video0 but nothing changes.