Skip to content

Commit

Permalink
Relative scrolling; support from nerfvis import scene
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyu committed Aug 24, 2022
1 parent ced510a commit d18c4b1
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 33 deletions.
2 changes: 1 addition & 1 deletion docs/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 6e349a30ef147d0ba6473c65052249b9
config: 441a70d48d320b00669b6d85f4cdc849
tags: 645f666f9bcd5a90fca523b33c5a78b7
23 changes: 17 additions & 6 deletions docs/build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
Welcome to nerfvis's documentation!
===================================

This is an experimental PyTorch NeRF visualization utility based on PlenOctrees.
This is a PyTorch NeRF visualization utility based on PlenOctrees, as well as a
general web-based 3D visualization library.

Install with :code:`pip install nerfvis`. This is a pure-Python library. The base library has no dependencies except for :code:`numpy`.
Adding meshes from a file requires :code:`trimesh`.
Expand All @@ -18,12 +19,22 @@ Basic usage example:
import nerfvis
scene = nerfvis.Scene("My title")
scene.add_cube("Cube1", color=[1.0, 0.0, 0.0], translation=[-1.0, -1.0, 0.0])
scene.add_cube("Cube/1", color=[1.0, 0.0, 0.0], translation=[-1.0, -1.0, 0.0])
scene.add_wireframe_cube("Cube/2", color=[1.0, 0.0, 0.0],
translation=[-1.0, -1.0, 0.0], scale=2.0)
scene.add_axes()
scene.set_nerf(nerf_func, center=[0.0, 0.0, 0.0], radius=1.5, use_dirs=True)
scene.display(port=8889)
# Tries to open the scene in your browser
# (you may have to forward the port and enter localhost:8889 manually if over ssh)
scene.set_nerf(nerf_func, center=[0.0, 0.0, 0.0], radius=1.5, use_dirs=True) # Optional
scene.display() # Serves at localhost:8888 or first port available after that
scene.export("folder") # Exports sources to location
scene.embed() # Embed in IPython notebook
Scene: holds objects. If you only use one scene, feel free to use :code:`from nerfvis import scene` instead.

Names separated by :code:`/` will be collapsed into a tree in the layers panel in the output.


Other common functions include `add_camera_frustum`, `add_mesh`, `add_line`, `add_lines`,
`add_image`

Please see :ref:`nerfvis` for details.

Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '0.0.16',
VERSION: '0.0.17',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
4 changes: 3 additions & 1 deletion docs/build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Index &mdash; nerfvis 0.0.16 documentation</title>
<title>Index &mdash; nerfvis 0.0.17 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
Expand Down Expand Up @@ -163,6 +163,8 @@ <h2 id="S">S</h2>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="nerfvis.html#nerfvis.Scene.set_nerf">set_nerf() (Scene method)</a>
</li>
<li><a href="nerfvis.html#nerfvis.Scene.set_title">set_title() (Scene method)</a>
</li>
</ul></td>
</tr></table>
Expand Down
21 changes: 14 additions & 7 deletions docs/build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Welcome to nerfvis’s documentation! &mdash; nerfvis 0.0.16 documentation</title>
<title>Welcome to nerfvis’s documentation! &mdash; nerfvis 0.0.17 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
Expand Down Expand Up @@ -68,21 +68,28 @@

<section id="welcome-to-nerfvis-s-documentation">
<h1>Welcome to nerfvis’s documentation!<a class="headerlink" href="#welcome-to-nerfvis-s-documentation" title="Permalink to this heading"></a></h1>
<p>This is an experimental PyTorch NeRF visualization utility based on PlenOctrees.</p>
<p>This is a PyTorch NeRF visualization utility based on PlenOctrees, as well as a
general web-based 3D visualization library.</p>
<p>Install with <code class="code docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">nerfvis</span></code>. This is a pure-Python library. The base library has no dependencies except for <code class="code docutils literal notranslate"><span class="pre">numpy</span></code>.
Adding meshes from a file requires <code class="code docutils literal notranslate"><span class="pre">trimesh</span></code>.
Adding NeRF requires <code class="code docutils literal notranslate"><span class="pre">torch,</span> <span class="pre">svox,</span> <span class="pre">tqdm,</span> <span class="pre">scipy</span></code>.</p>
<p>Basic usage example:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">nerfvis</span>
<span class="n">scene</span> <span class="o">=</span> <span class="n">nerfvis</span><span class="o">.</span><span class="n">Scene</span><span class="p">(</span><span class="s2">&quot;My title&quot;</span><span class="p">)</span>
<span class="n">scene</span><span class="o">.</span><span class="n">add_cube</span><span class="p">(</span><span class="s2">&quot;Cube1&quot;</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="p">[</span><span class="mf">1.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">],</span> <span class="n">translation</span><span class="o">=</span><span class="p">[</span><span class="o">-</span><span class="mf">1.0</span><span class="p">,</span> <span class="o">-</span><span class="mf">1.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">])</span>
<span class="n">scene</span><span class="o">.</span><span class="n">add_cube</span><span class="p">(</span><span class="s2">&quot;Cube/1&quot;</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="p">[</span><span class="mf">1.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">],</span> <span class="n">translation</span><span class="o">=</span><span class="p">[</span><span class="o">-</span><span class="mf">1.0</span><span class="p">,</span> <span class="o">-</span><span class="mf">1.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">])</span>
<span class="n">scene</span><span class="o">.</span><span class="n">add_wireframe_cube</span><span class="p">(</span><span class="s2">&quot;Cube/2&quot;</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="p">[</span><span class="mf">1.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">],</span>
<span class="n">translation</span><span class="o">=</span><span class="p">[</span><span class="o">-</span><span class="mf">1.0</span><span class="p">,</span> <span class="o">-</span><span class="mf">1.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">],</span> <span class="n">scale</span><span class="o">=</span><span class="mf">2.0</span><span class="p">)</span>
<span class="n">scene</span><span class="o">.</span><span class="n">add_axes</span><span class="p">()</span>
<span class="n">scene</span><span class="o">.</span><span class="n">set_nerf</span><span class="p">(</span><span class="n">nerf_func</span><span class="p">,</span> <span class="n">center</span><span class="o">=</span><span class="p">[</span><span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">],</span> <span class="n">radius</span><span class="o">=</span><span class="mf">1.5</span><span class="p">,</span> <span class="n">use_dirs</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">scene</span><span class="o">.</span><span class="n">display</span><span class="p">(</span><span class="n">port</span><span class="o">=</span><span class="mi">8889</span><span class="p">)</span>
<span class="c1"># Tries to open the scene in your browser</span>
<span class="c1"># (you may have to forward the port and enter localhost:8889 manually if over ssh)</span>
<span class="n">scene</span><span class="o">.</span><span class="n">set_nerf</span><span class="p">(</span><span class="n">nerf_func</span><span class="p">,</span> <span class="n">center</span><span class="o">=</span><span class="p">[</span><span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">],</span> <span class="n">radius</span><span class="o">=</span><span class="mf">1.5</span><span class="p">,</span> <span class="n">use_dirs</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="c1"># Optional</span>
<span class="n">scene</span><span class="o">.</span><span class="n">display</span><span class="p">()</span> <span class="c1"># Serves at localhost:8888 or first port available after that</span>
<span class="n">scene</span><span class="o">.</span><span class="n">export</span><span class="p">(</span><span class="s2">&quot;folder&quot;</span><span class="p">)</span> <span class="c1"># Exports sources to location</span>
<span class="n">scene</span><span class="o">.</span><span class="n">embed</span><span class="p">()</span> <span class="c1"># Embed in IPython notebook</span>
</pre></div>
</div>
<p>Scene: holds objects. If you only use one scene, feel free to use <code class="code docutils literal notranslate"><span class="pre">from</span> <span class="pre">nerfvis</span> <span class="pre">import</span> <span class="pre">scene</span></code> instead.</p>
<p>Names separated by <code class="code docutils literal notranslate"><span class="pre">/</span></code> will be collapsed into a tree in the layers panel in the output.</p>
<p>Other common functions include <cite>add_camera_frustum</cite>, <cite>add_mesh</cite>, <cite>add_line</cite>, <cite>add_lines</cite>,
<cite>add_image</cite></p>
<p>Please see <a class="reference internal" href="nerfvis.html#nerfvis"><span class="std std-ref">Reference</span></a> for details.</p>
<div class="toctree-wrapper compound">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
Expand Down
Loading

0 comments on commit d18c4b1

Please sign in to comment.