ardaduz / deep-video-mvs

Code for "DeepVideoMVS: Multi-View Stereo on Video with Recurrent Spatio-Temporal Fusion" (CVPR 2021)
MIT License
221 stars 29 forks source link

Running on Colab #14

Closed BiaBibii closed 2 years ago

BiaBibii commented 2 years ago

Hello, I'm trying to run this code in google colab, and I get this error. I tried to use imageio, skimage instead of cv2.imread, but it doesn't work. Thanks

!python run-testing-online.py

qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" 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: eglfs, minimal, minimalegl, offscreen, vnc, webgl, xcb.

ardaduz commented 2 years ago

Hi,

The error you're getting is not related to how we load images, i.e., it is not about cv2.imread. Rather, it is about how we visualize the depth predictions while running run-testing-online.py. visualize_predictions here, calls cv2.imshow function here, which uses Qt backend to open a GUI window to show the depth predictions. This requires some kind of physical display connection and/or X server which Google Colab machines naturally do not have. There are many threads on the same problem you're facing such as this one or this one.

Now that we've established the reason, let's discuss the solution. You can set Config.test_visualize=False here, which disables the visualization.

If you have to use Google Colab and if you want to look at the depth predictions, I can suggest two things:

  1. The predictions are already being saved to an .npz file in this function. Download this .npz file to your local machine that has a screen, and write a piece of code that goes through the predictions and shows them.
  2. Modify the code slightly to use cv2.imwrite to save the predictions as PNG images somewhere on Google Drive, so that you can visually inspect them later.