Cannot use Intel RealSense Camera as input camera to YOLOv4

Hello,
I just tried using the intel RealSense camera as an input camera for the YOLOv4 but whenever I run it it shows the following error after loading the weights. Intel RealSense camera shows the output video perfectly when opened using Intel realsense-viewer. I was able to use the Intel RealSense as an input camera (or as webcam) on Jetson AGX Xavier but on Jetson TX2 its giving me error. Any help appreciated. Thanks.

Error is as follows:
32 conv 128 1 x 1/ 1 13 x 13 x 256 → 13 x 13 x 128 0.011 BF
33 upsample 2x 13 x 13 x 128 → 26 x 26 x 128
34 route 33 23 → 26 x 26 x 384
35 conv 256 3 x 3/ 1 26 x 26 x 384 → 26 x 26 x 256 1.196 BF
36 conv 18 1 x 1/ 1 26 x 26 x 256 → 26 x 26 x 18 0.006 BF
37 yolo
[yolo] params: iou loss: ciou (4), iou_norm: 0.07, obj_norm: 1.00, cls_norm: 1.00, delta_norm: 1.00, scale_x_y: 1.05
nms_kind: greedynms (1), beta = 0.600000
Total BFLOPS 6.787
avg_outputs = 299663
Allocate additional workspace_size = 26.22 MB
Loading weights from yolov4-tiny_final.weights…
seen 64, trained: 384 K-images (6 Kilo-batches_64)
Done! Loaded 38 layers from weights-file
Webcam index: 0
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (1757) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Internal data stream error.
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (886) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
^Z
[5]+ Stopped ./darknet detector demo cfg/obj.data cfg/yolov4-tiny.cfg yolov4-tiny_final.weights -c 0

Hi,

Based on the error, it seems that your camera cannot be opened via OpenCV+GStreamer.
Have you verified it? If not, please validate it first.

Thanks.

Hello,
I just started experimenting with the Jetson TX2 and intel RealSense can you please tell me how to verify the camera. Thankyou for your reply.

Hi,

Guess that you are open the camera with the OpenCV interface.
Could you check if it can work correctly?

It seems there are some example from their webpage:

Thanks.

Hello.
I was able to fix the issue. It has some problems with the OpenCV code and port number to which the Intel DepthSense was connected. Thanks for your help.

Good to know this.
Thanks for your update.