Skip to content

Commit

Permalink
Update viewer docs (nerfstudio-project#2826)
Browse files Browse the repository at this point in the history
* Update viewer docs

* Typo
  • Loading branch information
brentyi authored Jan 27, 2024
1 parent 1aba4ea commit 1bc5b42
Showing 1 changed file with 54 additions and 34 deletions.
88 changes: 54 additions & 34 deletions docs/quickstart/viewer_quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,60 @@ Using the viewer

The nerfstudio web-based viewer makes it easy to view training in real-time, and to create content videos from your trained models 🌟!

In the tutorial below, we walk you through how you can turn a simple capture into a 3D video 📸 🎬
Connecting to the viewer
^^^^^^^^^^^^^^^^^^^^^^^^

The nerfstudio viewer is launched automatically with each :code:`ns-train` training run! It can also be run separately with :code:`ns-viewer`.
To access a viewer, we need to enter the server's address and port in a web browser.

Accessing on a local machine
""""""""""""""""""""""""""""

You should be able to click the link obtained while running a script to open the viewer in your browser. This should typically look something like :code:`http://localhost:7007`.

Accessing over an SSH connection
""""""""""""""""""""""""""""""""

If you are training on a remote machine, the viewer will still let you view your trainings. You will need to forward traffic from your viewing host to the listening port on the host running ns-train (7007 by default). You can achieve this by securely tunneling traffic on the specified port through an ssh session. In a terminal window on the viewing host, issue the following command:

.. code-block:: bash
ssh -L 7007:127.0.0.1:7007 <username>@<training-host-ip>
.. admonition:: Note

You can now simply open the link (same one shown in image above) in your browser on your local machine and it should connect!. So long as you don't close this terminal window with this specific active ssh connection, the port will remain open for all your other ssh sessions.

For example, if you do this in a new terminal window, any existing ssh sessions (terminal windows, VSCode remote connection, etc) will still be able to access the port, but if you close this terminal window, the port will be closed.


.. warning::
If the port is being used, you will need to switch the port using the `--viewer.websocket-port` flag tied to the model subcommand.


Accessing via a share link
""""""""""""""""""""""""""

To connect to remote machines without requiring an SSH connection, we also support creating share URLs.
This can be generated from the "Share:" icon in the GUI, or from the CLI by specifying the :code:`--viewer.make-share-url True` argument.
This will create a publically accessible link that you can share with others to view your training progress.
This is useful for sharing training progress with collaborators, or for viewing training progress on a remote machine without requiring an SSH connection.
However, it will introduce some latency in the viewer.


.. seealso::

For a more in-depth developer overview on how to hack with the viewer, see our `developer guide </docs/_build/html/developer_guides/viewer/index.html>`_


Legacy viewer tutorial video
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In the tutorial video below, we walk you through how you can turn a simple capture into a 3D video 📸 🎬

This video is for the legacy viewer, which was the default in :code:`nerfstudio<1.0`. It has some visual differences from the current viewer. However, the core functionality is the same.
The legacy viewer can still be enabled with the :code:`--vis viewer_legacy` option, for example, :code:`ns-train nerfacto --vis viewer_legacy`.

.. raw:: html

Expand Down Expand Up @@ -40,36 +93,3 @@ Rendering a video
* `How to render final video <https://youtu.be/nSFsugarWzk?t=227>`_

|
.. seealso::

For a more in-depth developer overview on how to hack with the viewer, see our `developer guide </docs/_build/html/developer_guides/viewer/index.html>`_


Local vs. remote compute
""""""""""""""""""""""""""

Training on a local machine
---------------------------

You should be able to click the link obtained while running a script to open the viewer in your browser.

Training on a remote machine
----------------------------

If you are training on a remote machine, the viewer will still let you view your trainings. You will need to forward traffic from your viewing host to the listening port on the host running ns-train (7007 by default). You can achieve this by securely tunneling traffic on the specified port through an ssh session. In a terminal window on the viewing host, issue the following command:

.. code-block:: bash
ssh -L 7007:<training-host-ip>:7007 <username>@<training-host-ip>
.. admonition:: Note

You can now simply open the link (same one shown in image above) in your browser on your local machine and it should connect!. So long as you don't close this terminal window with this specific active ssh connection, the port will remain open for all your other ssh sessions.

For example, if you do this in a new terminal window, any existing ssh sessions (terminal windows, VSCode remote connection, etc) will still be able to access the port, but if you close this terminal window, the port will be closed.


.. warning::
If the port is being used, you will need to switch the port using the `--viewer.websocket-port` flag tied to the model subcommand.

0 comments on commit 1bc5b42

Please sign in to comment.