Green Screen and Object Detection

Hi, i am using a darknet for object detection. I have been trying to apply the weight file that we have trained in YOLOv4 to the camera for a while now.
However, when I try to run the darknet demo, I get a green screen when i run the command below.

./darknet detector demo data/obj.data cfg/yolov4-obj.cfg weights/yolov4-obj_3000.weights -c 0

this is the output

./darknet detector demo data/obj.data cfg/yolov4-obj.cfg weights/yolov4-obj_3000.weights -c 0
 GPU isn't used 
 OpenCV version: 4.1.1
Demo
mini_batch = 1, batch = 1, time_steps = 1, train = 0 
   layer   filters  size/strd(dil)      input                output
   0 conv     32       3 x 3/ 1     32 x  32 x   3 ->   32 x  32 x  32 0.002 BF
   1 conv     64       3 x 3/ 2     32 x  32 x  32 ->   16 x  16 x  64 0.009 BF
   2 conv     64       1 x 1/ 1     16 x  16 x  64 ->   16 x  16 x  64 0.002 BF
   3 route  1 		                           ->   16 x  16 x  64 
   4 conv     64       1 x 1/ 1     16 x  16 x  64 ->   16 x  16 x  64 0.002 BF
   5 conv     32       1 x 1/ 1     16 x  16 x  64 ->   16 x  16 x  32 0.001 BF
   6 conv     64       3 x 3/ 1     16 x  16 x  32 ->   16 x  16 x  64 0.009 BF
   7 Shortcut Layer: 4,  wt = 0, wn = 0, outputs:  16 x  16 x  64 0.000 BF
   8 conv     64       1 x 1/ 1     16 x  16 x  64 ->   16 x  16 x  64 0.002 BF
   9 route  8 2 	                           ->   16 x  16 x 128 
  10 conv     64       1 x 1/ 1     16 x  16 x 128 ->   16 x  16 x  64 0.004 BF
  11 conv    128       3 x 3/ 2     16 x  16 x  64 ->    8 x   8 x 128 0.009 BF
  12 conv     64       1 x 1/ 1      8 x   8 x 128 ->    8 x   8 x  64 0.001 BF
  13 route  11 		                           ->    8 x   8 x 128 
  14 conv     64       1 x 1/ 1      8 x   8 x 128 ->    8 x   8 x  64 0.001 BF
  15 conv     64       1 x 1/ 1      8 x   8 x  64 ->    8 x   8 x  64 0.001 BF
  16 conv     64       3 x 3/ 1      8 x   8 x  64 ->    8 x   8 x  64 0.005 BF
  17 Shortcut Layer: 14,  wt = 0, wn = 0, outputs:   8 x   8 x  64 0.000 BF
  18 conv     64       1 x 1/ 1      8 x   8 x  64 ->    8 x   8 x  64 0.001 BF
  19 conv     64       3 x 3/ 1      8 x   8 x  64 ->    8 x   8 x  64 0.005 BF
  20 Shortcut Layer: 17,  wt = 0, wn = 0, outputs:   8 x   8 x  64 0.000 BF
  21 conv     64       1 x 1/ 1      8 x   8 x  64 ->    8 x   8 x  64 0.001 BF
  22 route  21 12 	                           ->    8 x   8 x 128 
  23 conv    128       1 x 1/ 1      8 x   8 x 128 ->    8 x   8 x 128 0.002 BF
  24 conv    256       3 x 3/ 2      8 x   8 x 128 ->    4 x   4 x 256 0.009 BF
  25 conv    128       1 x 1/ 1      4 x   4 x 256 ->    4 x   4 x 128 0.001 BF
  26 route  24 		                           ->    4 x   4 x 256 
  27 conv    128       1 x 1/ 1      4 x   4 x 256 ->    4 x   4 x 128 0.001 BF
  28 conv    128       1 x 1/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.001 BF
  29 conv    128       3 x 3/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.005 BF
  30 Shortcut Layer: 27,  wt = 0, wn = 0, outputs:   4 x   4 x 128 0.000 BF
  31 conv    128       1 x 1/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.001 BF
  32 conv    128       3 x 3/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.005 BF
  33 Shortcut Layer: 30,  wt = 0, wn = 0, outputs:   4 x   4 x 128 0.000 BF
  34 conv    128       1 x 1/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.001 BF
  35 conv    128       3 x 3/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.005 BF
  36 Shortcut Layer: 33,  wt = 0, wn = 0, outputs:   4 x   4 x 128 0.000 BF
  37 conv    128       1 x 1/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.001 BF
  38 conv    128       3 x 3/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.005 BF
  39 Shortcut Layer: 36,  wt = 0, wn = 0, outputs:   4 x   4 x 128 0.000 BF
  40 conv    128       1 x 1/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.001 BF
  41 conv    128       3 x 3/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.005 BF
  42 Shortcut Layer: 39,  wt = 0, wn = 0, outputs:   4 x   4 x 128 0.000 BF
  43 conv    128       1 x 1/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.001 BF
  44 conv    128       3 x 3/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.005 BF
  45 Shortcut Layer: 42,  wt = 0, wn = 0, outputs:   4 x   4 x 128 0.000 BF
  46 conv    128       1 x 1/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.001 BF
  47 conv    128       3 x 3/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.005 BF
  48 Shortcut Layer: 45,  wt = 0, wn = 0, outputs:   4 x   4 x 128 0.000 BF
  49 conv    128       1 x 1/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.001 BF
  50 conv    128       3 x 3/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.005 BF
  51 Shortcut Layer: 48,  wt = 0, wn = 0, outputs:   4 x   4 x 128 0.000 BF
  52 conv    128       1 x 1/ 1      4 x   4 x 128 ->    4 x   4 x 128 0.001 BF
  53 route  52 25 	                           ->    4 x   4 x 256 
  54 conv    256       1 x 1/ 1      4 x   4 x 256 ->    4 x   4 x 256 0.002 BF
  55 conv    512       3 x 3/ 2      4 x   4 x 256 ->    2 x   2 x 512 0.009 BF
  56 conv    256       1 x 1/ 1      2 x   2 x 512 ->    2 x   2 x 256 0.001 BF
  57 route  55 		                           ->    2 x   2 x 512 
  58 conv    256       1 x 1/ 1      2 x   2 x 512 ->    2 x   2 x 256 0.001 BF
  59 conv    256       1 x 1/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.001 BF
  60 conv    256       3 x 3/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.005 BF
  61 Shortcut Layer: 58,  wt = 0, wn = 0, outputs:   2 x   2 x 256 0.000 BF
  62 conv    256       1 x 1/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.001 BF
  63 conv    256       3 x 3/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.005 BF
  64 Shortcut Layer: 61,  wt = 0, wn = 0, outputs:   2 x   2 x 256 0.000 BF
  65 conv    256       1 x 1/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.001 BF
  66 conv    256       3 x 3/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.005 BF
  67 Shortcut Layer: 64,  wt = 0, wn = 0, outputs:   2 x   2 x 256 0.000 BF
  68 conv    256       1 x 1/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.001 BF
  69 conv    256       3 x 3/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.005 BF
  70 Shortcut Layer: 67,  wt = 0, wn = 0, outputs:   2 x   2 x 256 0.000 BF
  71 conv    256       1 x 1/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.001 BF
  72 conv    256       3 x 3/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.005 BF
  73 Shortcut Layer: 70,  wt = 0, wn = 0, outputs:   2 x   2 x 256 0.000 BF
  74 conv    256       1 x 1/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.001 BF
  75 conv    256       3 x 3/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.005 BF
  76 Shortcut Layer: 73,  wt = 0, wn = 0, outputs:   2 x   2 x 256 0.000 BF
  77 conv    256       1 x 1/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.001 BF
  78 conv    256       3 x 3/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.005 BF
  79 Shortcut Layer: 76,  wt = 0, wn = 0, outputs:   2 x   2 x 256 0.000 BF
  80 conv    256       1 x 1/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.001 BF
  81 conv    256       3 x 3/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.005 BF
  82 Shortcut Layer: 79,  wt = 0, wn = 0, outputs:   2 x   2 x 256 0.000 BF
  83 conv    256       1 x 1/ 1      2 x   2 x 256 ->    2 x   2 x 256 0.001 BF
  84 route  83 56 	                           ->    2 x   2 x 512 
  85 conv    512       1 x 1/ 1      2 x   2 x 512 ->    2 x   2 x 512 0.002 BF
  86 conv   1024       3 x 3/ 2      2 x   2 x 512 ->    1 x   1 x1024 0.009 BF
  87 conv    512       1 x 1/ 1      1 x   1 x1024 ->    1 x   1 x 512 0.001 BF
  88 route  86 		                           ->    1 x   1 x1024 
  89 conv    512       1 x 1/ 1      1 x   1 x1024 ->    1 x   1 x 512 0.001 BF
  90 conv    512       1 x 1/ 1      1 x   1 x 512 ->    1 x   1 x 512 0.001 BF
  91 conv    512       3 x 3/ 1      1 x   1 x 512 ->    1 x   1 x 512 0.005 BF
  92 Shortcut Layer: 89,  wt = 0, wn = 0, outputs:   1 x   1 x 512 0.000 BF
  93 conv    512       1 x 1/ 1      1 x   1 x 512 ->    1 x   1 x 512 0.001 BF
  94 conv    512       3 x 3/ 1      1 x   1 x 512 ->    1 x   1 x 512 0.005 BF
  95 Shortcut Layer: 92,  wt = 0, wn = 0, outputs:   1 x   1 x 512 0.000 BF
  96 conv    512       1 x 1/ 1      1 x   1 x 512 ->    1 x   1 x 512 0.001 BF
  97 conv    512       3 x 3/ 1      1 x   1 x 512 ->    1 x   1 x 512 0.005 BF
  98 Shortcut Layer: 95,  wt = 0, wn = 0, outputs:   1 x   1 x 512 0.000 BF
  99 conv    512       1 x 1/ 1      1 x   1 x 512 ->    1 x   1 x 512 0.001 BF
 100 conv    512       3 x 3/ 1      1 x   1 x 512 ->    1 x   1 x 512 0.005 BF
 101 Shortcut Layer: 98,  wt = 0, wn = 0, outputs:   1 x   1 x 512 0.000 BF
 102 conv    512       1 x 1/ 1      1 x   1 x 512 ->    1 x   1 x 512 0.001 BF
 103 route  102 87 	                           ->    1 x   1 x1024 
 104 conv   1024       1 x 1/ 1      1 x   1 x1024 ->    1 x   1 x1024 0.002 BF
 105 conv    512       1 x 1/ 1      1 x   1 x1024 ->    1 x   1 x 512 0.001 BF
 106 conv   1024       3 x 3/ 1      1 x   1 x 512 ->    1 x   1 x1024 0.009 BF
 107 conv    512       1 x 1/ 1      1 x   1 x1024 ->    1 x   1 x 512 0.001 BF
 108 max                5x 5/ 1      1 x   1 x 512 ->    1 x   1 x 512 0.000 BF
 109 route  107 		                           ->    1 x   1 x 512 
 110 max                9x 9/ 1      1 x   1 x 512 ->    1 x   1 x 512 0.000 BF
 111 route  107 		                           ->    1 x   1 x 512 
 112 max               13x13/ 1      1 x   1 x 512 ->    1 x   1 x 512 0.000 BF
 113 route  112 110 108 107 	                   ->    1 x   1 x2048 
 114 conv    512       1 x 1/ 1      1 x   1 x2048 ->    1 x   1 x 512 0.002 BF
 115 conv   1024       3 x 3/ 1      1 x   1 x 512 ->    1 x   1 x1024 0.009 BF
 116 conv    512       1 x 1/ 1      1 x   1 x1024 ->    1 x   1 x 512 0.001 BF
 117 conv    256       1 x 1/ 1      1 x   1 x 512 ->    1 x   1 x 256 0.000 BF
 118 upsample                 2x     1 x   1 x 256 ->    2 x   2 x 256
 119 route  85 		                           ->    2 x   2 x 512 
 120 conv    256       1 x 1/ 1      2 x   2 x 512 ->    2 x   2 x 256 0.001 BF
 121 route  120 118 	                           ->    2 x   2 x 512 
 122 conv    256       1 x 1/ 1      2 x   2 x 512 ->    2 x   2 x 256 0.001 BF
 123 conv    512       3 x 3/ 1      2 x   2 x 256 ->    2 x   2 x 512 0.009 BF
 124 conv    256       1 x 1/ 1      2 x   2 x 512 ->    2 x   2 x 256 0.001 BF
 125 conv    512       3 x 3/ 1      2 x   2 x 256 ->    2 x   2 x 512 0.009 BF
 126 conv    256       1 x 1/ 1      2 x   2 x 512 ->    2 x   2 x 256 0.001 BF
 127 conv    128       1 x 1/ 1      2 x   2 x 256 ->    2 x   2 x 128 0.000 BF
 128 upsample                 2x     2 x   2 x 128 ->    4 x   4 x 128
 129 route  54 		                           ->    4 x   4 x 256 
 130 conv    128       1 x 1/ 1      4 x   4 x 256 ->    4 x   4 x 128 0.001 BF
 131 route  130 128 	                           ->    4 x   4 x 256 
 132 conv    128       1 x 1/ 1      4 x   4 x 256 ->    4 x   4 x 128 0.001 BF
 133 conv    256       3 x 3/ 1      4 x   4 x 128 ->    4 x   4 x 256 0.009 BF
 134 conv    128       1 x 1/ 1      4 x   4 x 256 ->    4 x   4 x 128 0.001 BF
 135 conv    256       3 x 3/ 1      4 x   4 x 128 ->    4 x   4 x 256 0.009 BF
 136 conv    128       1 x 1/ 1      4 x   4 x 256 ->    4 x   4 x 128 0.001 BF
 137 conv     18       3 x 3/ 1      4 x   4 x 128 ->    4 x   4 x  18 0.001 BF
 138 conv     18       1 x 1/ 1      4 x   4 x  18 ->    4 x   4 x  18 0.000 BF
 139 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.20
nms_kind: greedynms (1), beta = 0.600000 
 140 route  136 		                           ->    4 x   4 x 128 
 141 conv    256       3 x 3/ 2      4 x   4 x 128 ->    2 x   2 x 256 0.002 BF
 142 route  141 126 	                           ->    2 x   2 x 512 
 143 conv    256       1 x 1/ 1      2 x   2 x 512 ->    2 x   2 x 256 0.001 BF
 144 conv    512       3 x 3/ 1      2 x   2 x 256 ->    2 x   2 x 512 0.009 BF
 145 conv    256       1 x 1/ 1      2 x   2 x 512 ->    2 x   2 x 256 0.001 BF
 146 conv    512       3 x 3/ 1      2 x   2 x 256 ->    2 x   2 x 512 0.009 BF
 147 conv    256       1 x 1/ 1      2 x   2 x 512 ->    2 x   2 x 256 0.001 BF
 148 conv    512       3 x 3/ 1      2 x   2 x 256 ->    2 x   2 x 512 0.009 BF
 149 conv     18       1 x 1/ 1      2 x   2 x 512 ->    2 x   2 x  18 0.000 BF
 150 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.10
nms_kind: greedynms (1), beta = 0.600000 
 151 route  147 		                           ->    2 x   2 x 256 
 152 conv    512       3 x 3/ 2      2 x   2 x 256 ->    1 x   1 x 512 0.002 BF
 153 route  152 116 	                           ->    1 x   1 x1024 
 154 conv    512       1 x 1/ 1      1 x   1 x1024 ->    1 x   1 x 512 0.001 BF
 155 conv   1024       3 x 3/ 1      1 x   1 x 512 ->    1 x   1 x1024 0.009 BF
 156 conv    512       1 x 1/ 1      1 x   1 x1024 ->    1 x   1 x 512 0.001 BF
 157 conv   1024       3 x 3/ 1      1 x   1 x 512 ->    1 x   1 x1024 0.009 BF
 158 conv    512       1 x 1/ 1      1 x   1 x1024 ->    1 x   1 x 512 0.001 BF
 159 conv   1024       3 x 3/ 1      1 x   1 x 512 ->    1 x   1 x1024 0.009 BF
 160 conv     18       1 x 1/ 1      1 x   1 x1024 ->    1 x   1 x  18 0.000 BF
 161 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 0.344 
avg_outputs = 3588 
Loading weights from weights/yolov4-obj_3000.weights...
 seen 64, trained: 192 K-images (3 Kilo-batches_64) 
Done! Loaded 162 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
Video stream: 3264 x 2464 
Gtk-Message: 15:06:14.421: Failed to load module "canberra-gtk-module"
Objects:


FPS:0.0 	 AVG_FPS:0.0
Objects:


FPS:0.1 	 AVG_FPS:1.2
Objects:

im solely run on jetson nano and for camera, im using raspberry pi camera module 2, Sony IMX219 8MP and its capable of 3280 x 2464 px static images. how to solve this issues? Thanks

Hi,

Since you are using a CSI camera, could you try if nvarguscamerasrc works?

For example:

$ ./darknet detector demo data/obj.data cfg/yolov4-obj.cfg weights/yolov4-obj_3000.weights "nvarguscamerasrc ! video/x-raw(memory:NVMM), width=1280, height=720, format=NV12, framerate=30/1 ! nvvidconv  ! video/x-raw, width=1280, height=720, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink"

Thanks.

whe i try the command below,

./darknet detector demo data/obj.data cfg/yolov4-obj.cfg weights/yolov4-obj_3000.weights nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=960, height=540, format=NV12, framerate=30/1' ! nvoverlaysink
                        
                                                     or

./darknet detector demo data/obj.data cfg/yolov4-obj.cfg weights/yolov4-obj_3000.weights nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1280, height=720, format=NV12, framerate=30/1' ! nvvidconv  ! video/x-raw, width=1280, height=720, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink

it gives an output

~/darknet$ ./darknet detector demo data/obj.data cfg/yolov4-obj.cfg weights/yolov4-obj_3000.weights nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1280, height=720, format=NV12, framerate=30/1' ! nvvidconv  ! video/x-raw, width=1280, height=720, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink
 GPU isn't used 
 OpenCV version: 4.1.1
Demo
mini_batch = 1, batch = 1, time_steps = 1, train = 0 
   layer   filters  size/strd(dil)      input                output
   0 conv     32       3 x 3/ 1    320 x 320 x   3 ->  320 x 320 x  32 0.177 BF
   1 conv     64       3 x 3/ 2    320 x 320 x  32 ->  160 x 160 x  64 0.944 BF
   2 conv     64       1 x 1/ 1    160 x 160 x  64 ->  160 x 160 x  64 0.210 BF
   3 route  1 		                           ->  160 x 160 x  64 
   4 conv     64       1 x 1/ 1    160 x 160 x  64 ->  160 x 160 x  64 0.210 BF
   5 conv     32       1 x 1/ 1    160 x 160 x  64 ->  160 x 160 x  32 0.105 BF
   6 conv     64       3 x 3/ 1    160 x 160 x  32 ->  160 x 160 x  64 0.944 BF
   7 Shortcut Layer: 4,  wt = 0, wn = 0, outputs: 160 x 160 x  64 0.002 BF
   8 conv     64       1 x 1/ 1    160 x 160 x  64 ->  160 x 160 x  64 0.210 BF
   9 route  8 2 	                           ->  160 x 160 x 128 
  10 conv     64       1 x 1/ 1    160 x 160 x 128 ->  160 x 160 x  64 0.419 BF
  11 conv    128       3 x 3/ 2    160 x 160 x  64 ->   80 x  80 x 128 0.944 BF
  12 conv     64       1 x 1/ 1     80 x  80 x 128 ->   80 x  80 x  64 0.105 BF
  13 route  11 		                           ->   80 x  80 x 128 
  14 conv     64       1 x 1/ 1     80 x  80 x 128 ->   80 x  80 x  64 0.105 BF
  15 conv     64       1 x 1/ 1     80 x  80 x  64 ->   80 x  80 x  64 0.052 BF
  16 conv     64       3 x 3/ 1     80 x  80 x  64 ->   80 x  80 x  64 0.472 BF
  17 Shortcut Layer: 14,  wt = 0, wn = 0, outputs:  80 x  80 x  64 0.000 BF
  18 conv     64       1 x 1/ 1     80 x  80 x  64 ->   80 x  80 x  64 0.052 BF
  19 conv     64       3 x 3/ 1     80 x  80 x  64 ->   80 x  80 x  64 0.472 BF
  20 Shortcut Layer: 17,  wt = 0, wn = 0, outputs:  80 x  80 x  64 0.000 BF
  21 conv     64       1 x 1/ 1     80 x  80 x  64 ->   80 x  80 x  64 0.052 BF
  22 route  21 12 	                           ->   80 x  80 x 128 
  23 conv    128       1 x 1/ 1     80 x  80 x 128 ->   80 x  80 x 128 0.210 BF
  24 conv    256       3 x 3/ 2     80 x  80 x 128 ->   40 x  40 x 256 0.944 BF
  25 conv    128       1 x 1/ 1     40 x  40 x 256 ->   40 x  40 x 128 0.105 BF
  26 route  24 		                           ->   40 x  40 x 256 
  27 conv    128       1 x 1/ 1     40 x  40 x 256 ->   40 x  40 x 128 0.105 BF
  28 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  29 conv    128       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.472 BF
  30 Shortcut Layer: 27,  wt = 0, wn = 0, outputs:  40 x  40 x 128 0.000 BF
  31 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  32 conv    128       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.472 BF
  33 Shortcut Layer: 30,  wt = 0, wn = 0, outputs:  40 x  40 x 128 0.000 BF
  34 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  35 conv    128       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.472 BF
  36 Shortcut Layer: 33,  wt = 0, wn = 0, outputs:  40 x  40 x 128 0.000 BF
  37 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  38 conv    128       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.472 BF
  39 Shortcut Layer: 36,  wt = 0, wn = 0, outputs:  40 x  40 x 128 0.000 BF
  40 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  41 conv    128       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.472 BF
  42 Shortcut Layer: 39,  wt = 0, wn = 0, outputs:  40 x  40 x 128 0.000 BF
  43 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  44 conv    128       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.472 BF
  45 Shortcut Layer: 42,  wt = 0, wn = 0, outputs:  40 x  40 x 128 0.000 BF
  46 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  47 conv    128       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.472 BF
  48 Shortcut Layer: 45,  wt = 0, wn = 0, outputs:  40 x  40 x 128 0.000 BF
  49 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  50 conv    128       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.472 BF
  51 Shortcut Layer: 48,  wt = 0, wn = 0, outputs:  40 x  40 x 128 0.000 BF
  52 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  53 route  52 25 	                           ->   40 x  40 x 256 
  54 conv    256       1 x 1/ 1     40 x  40 x 256 ->   40 x  40 x 256 0.210 BF
  55 conv    512       3 x 3/ 2     40 x  40 x 256 ->   20 x  20 x 512 0.944 BF
  56 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
  57 route  55 		                           ->   20 x  20 x 512 
  58 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
  59 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  60 conv    256       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.472 BF
  61 Shortcut Layer: 58,  wt = 0, wn = 0, outputs:  20 x  20 x 256 0.000 BF
  62 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  63 conv    256       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.472 BF
  64 Shortcut Layer: 61,  wt = 0, wn = 0, outputs:  20 x  20 x 256 0.000 BF
  65 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  66 conv    256       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.472 BF
  67 Shortcut Layer: 64,  wt = 0, wn = 0, outputs:  20 x  20 x 256 0.000 BF
  68 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  69 conv    256       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.472 BF
  70 Shortcut Layer: 67,  wt = 0, wn = 0, outputs:  20 x  20 x 256 0.000 BF
  71 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  72 conv    256       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.472 BF
  73 Shortcut Layer: 70,  wt = 0, wn = 0, outputs:  20 x  20 x 256 0.000 BF
  74 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  75 conv    256       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.472 BF
  76 Shortcut Layer: 73,  wt = 0, wn = 0, outputs:  20 x  20 x 256 0.000 BF
  77 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  78 conv    256       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.472 BF
  79 Shortcut Layer: 76,  wt = 0, wn = 0, outputs:  20 x  20 x 256 0.000 BF
  80 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  81 conv    256       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.472 BF
  82 Shortcut Layer: 79,  wt = 0, wn = 0, outputs:  20 x  20 x 256 0.000 BF
  83 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  84 route  83 56 	                           ->   20 x  20 x 512 
  85 conv    512       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 512 0.210 BF
  86 conv   1024       3 x 3/ 2     20 x  20 x 512 ->   10 x  10 x1024 0.944 BF
  87 conv    512       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x 512 0.105 BF
  88 route  86 		                           ->   10 x  10 x1024 
  89 conv    512       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x 512 0.105 BF
  90 conv    512       1 x 1/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.052 BF
  91 conv    512       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.472 BF
  92 Shortcut Layer: 89,  wt = 0, wn = 0, outputs:  10 x  10 x 512 0.000 BF
  93 conv    512       1 x 1/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.052 BF
  94 conv    512       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.472 BF
  95 Shortcut Layer: 92,  wt = 0, wn = 0, outputs:  10 x  10 x 512 0.000 BF
  96 conv    512       1 x 1/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.052 BF
  97 conv    512       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.472 BF
  98 Shortcut Layer: 95,  wt = 0, wn = 0, outputs:  10 x  10 x 512 0.000 BF
  99 conv    512       1 x 1/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.052 BF
 100 conv    512       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.472 BF
 101 Shortcut Layer: 98,  wt = 0, wn = 0, outputs:  10 x  10 x 512 0.000 BF
 102 conv    512       1 x 1/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.052 BF
 103 route  102 87 	                           ->   10 x  10 x1024 
 104 conv   1024       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x1024 0.210 BF
 105 conv    512       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x 512 0.105 BF
 106 conv   1024       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x1024 0.944 BF
 107 conv    512       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x 512 0.105 BF
 108 max                5x 5/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.001 BF
 109 route  107 		                           ->   10 x  10 x 512 
 110 max                9x 9/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.004 BF
 111 route  107 		                           ->   10 x  10 x 512 
 112 max               13x13/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.009 BF
 113 route  112 110 108 107 	                   ->   10 x  10 x2048 
 114 conv    512       1 x 1/ 1     10 x  10 x2048 ->   10 x  10 x 512 0.210 BF
 115 conv   1024       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x1024 0.944 BF
 116 conv    512       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x 512 0.105 BF
 117 conv    256       1 x 1/ 1     10 x  10 x 512 ->   10 x  10 x 256 0.026 BF
 118 upsample                 2x    10 x  10 x 256 ->   20 x  20 x 256
 119 route  85 		                           ->   20 x  20 x 512 
 120 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
 121 route  120 118 	                           ->   20 x  20 x 512 
 122 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
 123 conv    512       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 512 0.944 BF
 124 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
 125 conv    512       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 512 0.944 BF
 126 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
 127 conv    128       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 128 0.026 BF
 128 upsample                 2x    20 x  20 x 128 ->   40 x  40 x 128
 129 route  54 		                           ->   40 x  40 x 256 
 130 conv    128       1 x 1/ 1     40 x  40 x 256 ->   40 x  40 x 128 0.105 BF
 131 route  130 128 	                           ->   40 x  40 x 256 
 132 conv    128       1 x 1/ 1     40 x  40 x 256 ->   40 x  40 x 128 0.105 BF
 133 conv    256       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 256 0.944 BF
 134 conv    128       1 x 1/ 1     40 x  40 x 256 ->   40 x  40 x 128 0.105 BF
 135 conv    256       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 256 0.944 BF
 136 conv    128       1 x 1/ 1     40 x  40 x 256 ->   40 x  40 x 128 0.105 BF
 137 conv     18       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x  18 0.066 BF
 138 conv     18       1 x 1/ 1     40 x  40 x  18 ->   40 x  40 x  18 0.001 BF
 139 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.20
nms_kind: greedynms (1), beta = 0.600000 
 140 route  136 		                           ->   40 x  40 x 128 
 141 conv    256       3 x 3/ 2     40 x  40 x 128 ->   20 x  20 x 256 0.236 BF
 142 route  141 126 	                           ->   20 x  20 x 512 
 143 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
 144 conv    512       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 512 0.944 BF
 145 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
 146 conv    512       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 512 0.944 BF
 147 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
 148 conv    512       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 512 0.944 BF
 149 conv     18       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x  18 0.007 BF
 150 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.10
nms_kind: greedynms (1), beta = 0.600000 
 151 route  147 		                           ->   20 x  20 x 256 
 152 conv    512       3 x 3/ 2     20 x  20 x 256 ->   10 x  10 x 512 0.236 BF
 153 route  152 116 	                           ->   10 x  10 x1024 
 154 conv    512       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x 512 0.105 BF
 155 conv   1024       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x1024 0.944 BF
 156 conv    512       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x 512 0.105 BF
 157 conv   1024       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x1024 0.944 BF
 158 conv    512       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x 512 0.105 BF
 159 conv   1024       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x1024 0.944 BF
 160 conv     18       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x  18 0.004 BF
 161 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 34.353 
avg_outputs = 287459 
Loading weights from weights/yolov4-obj_3000.weights...
 seen 64, trained: 192 K-images (3 Kilo-batches_64) 
Done! Loaded 162 layers from weights-file 
video file: nvarguscamerasrc

(darknet:11797): GLib-GObject-WARNING **: 09:16:54.570: invalid cast from 'GstNvArgusCameraSrc' to 'GstBin'

(darknet:11797): GStreamer-CRITICAL **: 09:16:54.570: gst_bin_iterate_elements: assertion 'GST_IS_BIN (bin)' failed

(darknet:11797): GStreamer-CRITICAL **: 09:16:54.570: gst_iterator_next: assertion 'it != NULL' failed

(darknet:11797): GStreamer-CRITICAL **: 09:16:54.570: gst_iterator_free: assertion 'it != NULL' failed
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (801) open OpenCV | GStreamer warning: cannot find appsink in manual 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
[ERROR:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap.cpp (116) open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.1.1) /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): nvarguscamerasrc in function 'icvExtractPattern'


 Video-stream stopped! 
 Video-stream stopped! 
 Video-stream stopped! 
 Video-stream stopped! 


but when i test the camera using the command below, it works fine.

~/darknet$ gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1280, height=720, format=NV12, framerate=30/1' ! nvoverlaysink

how to overcome this issues? does it related with OpenCV version?

when i rerun te command, it does not give a green screem but an error output.

~/darknet$ ./darknet detector demo data/obj.data cfg/yolov4-obj.cfg weights/yolov4-obj_3000.weights -c 0
~/darknet$ ./darknet detector demo data/obj.data cfg/yolov4-obj.cfg weights/yolov4-obj_3000.weights -c 0
 GPU isn't used 
 OpenCV version: 4.1.1
Demo
mini_batch = 1, batch = 1, time_steps = 1, train = 0 
   layer   filters  size/strd(dil)      input                output
   0 conv     32       3 x 3/ 1    320 x 320 x   3 ->  320 x 320 x  32 0.177 BF
   1 conv     64       3 x 3/ 2    320 x 320 x  32 ->  160 x 160 x  64 0.944 BF
   2 conv     64       1 x 1/ 1    160 x 160 x  64 ->  160 x 160 x  64 0.210 BF
   3 route  1 		                           ->  160 x 160 x  64 
   4 conv     64       1 x 1/ 1    160 x 160 x  64 ->  160 x 160 x  64 0.210 BF
   5 conv     32       1 x 1/ 1    160 x 160 x  64 ->  160 x 160 x  32 0.105 BF
   6 conv     64       3 x 3/ 1    160 x 160 x  32 ->  160 x 160 x  64 0.944 BF
   7 Shortcut Layer: 4,  wt = 0, wn = 0, outputs: 160 x 160 x  64 0.002 BF
   8 conv     64       1 x 1/ 1    160 x 160 x  64 ->  160 x 160 x  64 0.210 BF
   9 route  8 2 	                           ->  160 x 160 x 128 
  10 conv     64       1 x 1/ 1    160 x 160 x 128 ->  160 x 160 x  64 0.419 BF
  11 conv    128       3 x 3/ 2    160 x 160 x  64 ->   80 x  80 x 128 0.944 BF
  12 conv     64       1 x 1/ 1     80 x  80 x 128 ->   80 x  80 x  64 0.105 BF
  13 route  11 		                           ->   80 x  80 x 128 
  14 conv     64       1 x 1/ 1     80 x  80 x 128 ->   80 x  80 x  64 0.105 BF
  15 conv     64       1 x 1/ 1     80 x  80 x  64 ->   80 x  80 x  64 0.052 BF
  16 conv     64       3 x 3/ 1     80 x  80 x  64 ->   80 x  80 x  64 0.472 BF
  17 Shortcut Layer: 14,  wt = 0, wn = 0, outputs:  80 x  80 x  64 0.000 BF
  18 conv     64       1 x 1/ 1     80 x  80 x  64 ->   80 x  80 x  64 0.052 BF
  19 conv     64       3 x 3/ 1     80 x  80 x  64 ->   80 x  80 x  64 0.472 BF
  20 Shortcut Layer: 17,  wt = 0, wn = 0, outputs:  80 x  80 x  64 0.000 BF
  21 conv     64       1 x 1/ 1     80 x  80 x  64 ->   80 x  80 x  64 0.052 BF
  22 route  21 12 	                           ->   80 x  80 x 128 
  23 conv    128       1 x 1/ 1     80 x  80 x 128 ->   80 x  80 x 128 0.210 BF
  24 conv    256       3 x 3/ 2     80 x  80 x 128 ->   40 x  40 x 256 0.944 BF
  25 conv    128       1 x 1/ 1     40 x  40 x 256 ->   40 x  40 x 128 0.105 BF
  26 route  24 		                           ->   40 x  40 x 256 
  27 conv    128       1 x 1/ 1     40 x  40 x 256 ->   40 x  40 x 128 0.105 BF
  28 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  29 conv    128       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.472 BF
  30 Shortcut Layer: 27,  wt = 0, wn = 0, outputs:  40 x  40 x 128 0.000 BF
  31 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  32 conv    128       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.472 BF
  33 Shortcut Layer: 30,  wt = 0, wn = 0, outputs:  40 x  40 x 128 0.000 BF
  34 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  35 conv    128       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.472 BF
  36 Shortcut Layer: 33,  wt = 0, wn = 0, outputs:  40 x  40 x 128 0.000 BF
  37 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  38 conv    128       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.472 BF
  39 Shortcut Layer: 36,  wt = 0, wn = 0, outputs:  40 x  40 x 128 0.000 BF
  40 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  41 conv    128       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.472 BF
  42 Shortcut Layer: 39,  wt = 0, wn = 0, outputs:  40 x  40 x 128 0.000 BF
  43 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  44 conv    128       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.472 BF
  45 Shortcut Layer: 42,  wt = 0, wn = 0, outputs:  40 x  40 x 128 0.000 BF
  46 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  47 conv    128       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.472 BF
  48 Shortcut Layer: 45,  wt = 0, wn = 0, outputs:  40 x  40 x 128 0.000 BF
  49 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  50 conv    128       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.472 BF
  51 Shortcut Layer: 48,  wt = 0, wn = 0, outputs:  40 x  40 x 128 0.000 BF
  52 conv    128       1 x 1/ 1     40 x  40 x 128 ->   40 x  40 x 128 0.052 BF
  53 route  52 25 	                           ->   40 x  40 x 256 
  54 conv    256       1 x 1/ 1     40 x  40 x 256 ->   40 x  40 x 256 0.210 BF
  55 conv    512       3 x 3/ 2     40 x  40 x 256 ->   20 x  20 x 512 0.944 BF
  56 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
  57 route  55 		                           ->   20 x  20 x 512 
  58 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
  59 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  60 conv    256       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.472 BF
  61 Shortcut Layer: 58,  wt = 0, wn = 0, outputs:  20 x  20 x 256 0.000 BF
  62 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  63 conv    256       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.472 BF
  64 Shortcut Layer: 61,  wt = 0, wn = 0, outputs:  20 x  20 x 256 0.000 BF
  65 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  66 conv    256       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.472 BF
  67 Shortcut Layer: 64,  wt = 0, wn = 0, outputs:  20 x  20 x 256 0.000 BF
  68 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  69 conv    256       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.472 BF
  70 Shortcut Layer: 67,  wt = 0, wn = 0, outputs:  20 x  20 x 256 0.000 BF
  71 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  72 conv    256       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.472 BF
  73 Shortcut Layer: 70,  wt = 0, wn = 0, outputs:  20 x  20 x 256 0.000 BF
  74 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  75 conv    256       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.472 BF
  76 Shortcut Layer: 73,  wt = 0, wn = 0, outputs:  20 x  20 x 256 0.000 BF
  77 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  78 conv    256       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.472 BF
  79 Shortcut Layer: 76,  wt = 0, wn = 0, outputs:  20 x  20 x 256 0.000 BF
  80 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  81 conv    256       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.472 BF
  82 Shortcut Layer: 79,  wt = 0, wn = 0, outputs:  20 x  20 x 256 0.000 BF
  83 conv    256       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 256 0.052 BF
  84 route  83 56 	                           ->   20 x  20 x 512 
  85 conv    512       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 512 0.210 BF
  86 conv   1024       3 x 3/ 2     20 x  20 x 512 ->   10 x  10 x1024 0.944 BF
  87 conv    512       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x 512 0.105 BF
  88 route  86 		                           ->   10 x  10 x1024 
  89 conv    512       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x 512 0.105 BF
  90 conv    512       1 x 1/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.052 BF
  91 conv    512       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.472 BF
  92 Shortcut Layer: 89,  wt = 0, wn = 0, outputs:  10 x  10 x 512 0.000 BF
  93 conv    512       1 x 1/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.052 BF
  94 conv    512       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.472 BF
  95 Shortcut Layer: 92,  wt = 0, wn = 0, outputs:  10 x  10 x 512 0.000 BF
  96 conv    512       1 x 1/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.052 BF
  97 conv    512       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.472 BF
  98 Shortcut Layer: 95,  wt = 0, wn = 0, outputs:  10 x  10 x 512 0.000 BF
  99 conv    512       1 x 1/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.052 BF
 100 conv    512       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.472 BF
 101 Shortcut Layer: 98,  wt = 0, wn = 0, outputs:  10 x  10 x 512 0.000 BF
 102 conv    512       1 x 1/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.052 BF
 103 route  102 87 	                           ->   10 x  10 x1024 
 104 conv   1024       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x1024 0.210 BF
 105 conv    512       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x 512 0.105 BF
 106 conv   1024       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x1024 0.944 BF
 107 conv    512       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x 512 0.105 BF
 108 max                5x 5/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.001 BF
 109 route  107 		                           ->   10 x  10 x 512 
 110 max                9x 9/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.004 BF
 111 route  107 		                           ->   10 x  10 x 512 
 112 max               13x13/ 1     10 x  10 x 512 ->   10 x  10 x 512 0.009 BF
 113 route  112 110 108 107 	                   ->   10 x  10 x2048 
 114 conv    512       1 x 1/ 1     10 x  10 x2048 ->   10 x  10 x 512 0.210 BF
 115 conv   1024       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x1024 0.944 BF
 116 conv    512       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x 512 0.105 BF
 117 conv    256       1 x 1/ 1     10 x  10 x 512 ->   10 x  10 x 256 0.026 BF
 118 upsample                 2x    10 x  10 x 256 ->   20 x  20 x 256
 119 route  85 		                           ->   20 x  20 x 512 
 120 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
 121 route  120 118 	                           ->   20 x  20 x 512 
 122 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
 123 conv    512       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 512 0.944 BF
 124 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
 125 conv    512       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 512 0.944 BF
 126 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
 127 conv    128       1 x 1/ 1     20 x  20 x 256 ->   20 x  20 x 128 0.026 BF
 128 upsample                 2x    20 x  20 x 128 ->   40 x  40 x 128
 129 route  54 		                           ->   40 x  40 x 256 
 130 conv    128       1 x 1/ 1     40 x  40 x 256 ->   40 x  40 x 128 0.105 BF
 131 route  130 128 	                           ->   40 x  40 x 256 
 132 conv    128       1 x 1/ 1     40 x  40 x 256 ->   40 x  40 x 128 0.105 BF
 133 conv    256       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 256 0.944 BF
 134 conv    128       1 x 1/ 1     40 x  40 x 256 ->   40 x  40 x 128 0.105 BF
 135 conv    256       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x 256 0.944 BF
 136 conv    128       1 x 1/ 1     40 x  40 x 256 ->   40 x  40 x 128 0.105 BF
 137 conv     18       3 x 3/ 1     40 x  40 x 128 ->   40 x  40 x  18 0.066 BF
 138 conv     18       1 x 1/ 1     40 x  40 x  18 ->   40 x  40 x  18 0.001 BF
 139 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.20
nms_kind: greedynms (1), beta = 0.600000 
 140 route  136 		                           ->   40 x  40 x 128 
 141 conv    256       3 x 3/ 2     40 x  40 x 128 ->   20 x  20 x 256 0.236 BF
 142 route  141 126 	                           ->   20 x  20 x 512 
 143 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
 144 conv    512       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 512 0.944 BF
 145 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
 146 conv    512       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 512 0.944 BF
 147 conv    256       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x 256 0.105 BF
 148 conv    512       3 x 3/ 1     20 x  20 x 256 ->   20 x  20 x 512 0.944 BF
 149 conv     18       1 x 1/ 1     20 x  20 x 512 ->   20 x  20 x  18 0.007 BF
 150 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.10
nms_kind: greedynms (1), beta = 0.600000 
 151 route  147 		                           ->   20 x  20 x 256 
 152 conv    512       3 x 3/ 2     20 x  20 x 256 ->   10 x  10 x 512 0.236 BF
 153 route  152 116 	                           ->   10 x  10 x1024 
 154 conv    512       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x 512 0.105 BF
 155 conv   1024       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x1024 0.944 BF
 156 conv    512       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x 512 0.105 BF
 157 conv   1024       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x1024 0.944 BF
 158 conv    512       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x 512 0.105 BF
 159 conv   1024       3 x 3/ 1     10 x  10 x 512 ->   10 x  10 x1024 0.944 BF
 160 conv     18       1 x 1/ 1     10 x  10 x1024 ->   10 x  10 x  18 0.004 BF
 161 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 34.353 
avg_outputs = 287459 
Loading weights from weights/yolov4-obj_3000.weights...
 seen 64, trained: 192 K-images (3 Kilo-batches_64) 
Done! Loaded 162 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
VIDIOC_STREAMON: Remote I/O error
VIDIOC_STREAMON: Remote I/O error
VIDIOC_STREAMON: Remote I/O error
VIDIOC_STREAMON: Remote I/O error
VIDIOC_STREAMON: Remote I/O error

it says “Remote I/O error”

Hi,

Could you try if the following command works?
(It uses ’ … ’ to wrap the pipeline command)

$ ./darknet detector demo data/obj.data cfg/yolov4-obj.cfg weights/yolov4-obj_3000.weights 'nvarguscamerasrc ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720,format=(string)NV12, framerate=(fraction)30/1 ! nvvidconv flip-method=2 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink'

Thanks.

at first, it doesn’t work. After I deleted the darknet folder and rebuilt it again and it works! but sometimes it stopped in the middle without any further output. I don’t know why that is happening. but thank you for helping me solve the issue!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.