MoyGcc / vid2avatar

Vid2Avatar: 3D Avatar Reconstruction from Videos in the Wild via Self-supervised Scene Decomposition (CVPR2023)
https://moygcc.github.io/vid2avatar/
Other
1.2k stars 102 forks source link

Problems with visualizaiton in virtual machine #21

Closed klaister closed 1 year ago

klaister commented 1 year ago

I am executing everything in a virtual machine, after training and testing your "video" example I got all the outputs, 42 canocial PLY meshes and 42 deformed PLY meshes in the outputs/Video/parkinglot/test_mesh,

When I try to visualize the avatar in 3d and run the vis.py python file, I get this error:

**(v2a) jupyter@vid2avatar:~/vid2avatar/visualization$ python vis.py --mode "dynamic" --path "/home/jupyter/vid2avatar/outputs/Video/parkinglot/test_mesh" 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, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

Aborted**

I think Qt can only run in a local machine and that's the reason why I can't make it run. https://stackoverflow.com/questions/56491808/could-not-connect-to-any-x-display-google-colab-run-time

Is there any "easy" fix or do I have to run it locally? I do not have a GPU, that's why I was executing it in the cloud.

Thank you for your amazing work.

MoyGcc commented 1 year ago

This issue relates to our 3D viewer (AITViewer). Sir @kaufManu, is there an easy way to run the visualization remotely?

kaufManu commented 1 year ago

Yes, this should be possible. aitviewer supports a remote workflow, where you run the interactive viewer on your local machine and stream data into it from a remote machine. You can make this work as follows.

First, run a script locally that creates a viewer instance like this:

from aitviewer.viewer import Viewer
from aitviewer.configuration import CONFIG as VC
VC.update_conf({"server_enabled": True})
viewer = Viewer(size=viewer_size)

This opens an empty viewer.

Change the visualization scripts that run on the remote server to use the RemoteViewer instead of the Viewer.

from aitviewer.remote.viewer import RemoteViewer
viz = RemoteViewer(host="IP of your local machine")

Now you can use all the "remote" renderables that you can find here: https://github.com/eth-ait/aitviewer/tree/main/aitviewer/remote/renderables

These renderables do not directly render anything to screen, but instead send data over to your local machine, where they are then visualized. For example, to visualize a mesh you can do:

from aitviewer.remote.renderables import RemoteMeshes
m1 = RemoteMeshes(viz, some_vertices_in_numpy, some_faces_in_numpy, name="a mesh")

This will create a new mesh in your local viewer. If you would like to add new frames (time steps) to an existing mesh, call m1.add_frames(new_vertices) or if you want to update an existing mesh at frame index i call m1.update_frames(vertices, i).

The examples of aitviewer contain a few scripts with a remote workflow, which might help you further.

This workflow requires that your virtual machine has access to the internet and that your local machine allows traffic on port 8417 (although that port can be changed).

Let me know how that works for you!