Google Colab error: Could not load the Qt platform plugin "xcb"

Viewed 1759

I'm trying to run this command on google colab

!python /content/yolov4-custom-functions/detect_video.py --weights ./checkpoints/yolov4-416 --size 416 --model yolov4 --video /content/yolov4-custom-functions/data/video/video.mp4 --output /content/yolov4-custom-functions/detections/results.avi

And upon running this, I'm getting this error..

qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/lib/python3.8/site-packages/cv2/qt/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb, minimal, offscreen.

Fatal Python error: Aborted

Current thread 0x00007f3ea147f780 (most recent call first):
  File "/content/yolov4-custom-functions/detect_video.py", line 165 in main
  File "/usr/local/lib/python3.8/site-packages/absl/app.py", line 251 in _run_main
  File "/usr/local/lib/python3.8/site-packages/absl/app.py", line 300 in run
  File "/content/yolov4-custom-functions/detect_video.py", line 178 in <module>

I tried reinstalling and looked for other answers but none of them seems to solve this problem for colab.

Help me out please.

1 Answers

Check out the cv2.imshow() function, cause Google Colab does not allow to use GUI so there might be errors when launching image here.

Related