mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-12 02:45:34 +08:00
* starting docs for pipelines * working on an example * clearing output * starting to implement config changes and add documentation * removing diff * format * templated pipeline notebook a bit * black
6.8 MiB
6.8 MiB
In [1]:
# HIDDEN
import plotly.graph_objects as go
webdocs_layout = go.Layout(
scene=dict(
aspectmode="data",
xaxis=dict(showspikes=False),
yaxis=dict(showspikes=False),
zaxis=dict(showspikes=False),
xaxis_visible=False,
yaxis_visible=False,
zaxis_visible=False,
),
scene_camera=dict(up=dict(x=0, y=1, z=0)),
margin=dict(r=0, b=10, l=0, t=10),
hovermode=False,
showlegend=False,
paper_bgcolor="rgba(0,0,0,0)",
)In [2]:
# COLLAPSED
import torch
from nerfactory.cameras import cameras
from nerfactory.utils import plotly as vis
import plotly.graph_objects as go
cx = 2
cy = 2
fx = 10
fy = 10
num_samples = 3
near_plane = 1
far_plane = 3
camera = cameras.PinholeCamera(cx, cy, fx, fy)
ray_bundle = camera.get_camera_ray_bundle()
bins = torch.linspace(near_plane, far_plane, num_samples + 1)[..., None]
ray_samples = ray_bundle.get_ray_samples(bin_starts=bins[:-1, :], bin_ends=bins[1:, :])
vis_rays = vis.get_ray_bundle_lines(ray_bundle, color="teal", length=far_plane)
fig = go.Figure(data=[vis_rays] + vis.get_frustums_mesh_list(ray_samples.frustums), layout=webdocs_layout)
fig.show()In [3]:
# COLLAPSED
fig = go.Figure(data=[vis_rays, vis.get_frustum_points(ray_samples.frustums)], layout=webdocs_layout)
fig.show()In [4]:
# COLLAPSED
fig = go.Figure(
data=[vis_rays] + vis.get_gaussian_ellipsoids_list(ray_samples.frustums.flatten().get_gaussian_blob()),
layout=webdocs_layout,
)
fig.show()