Skip to content

Commit

Permalink
Add note
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyu committed Jun 15, 2023
1 parent 43a47cf commit 218e26f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Tips:

- A list of all objects with the names you gave them will be displayed in a tree view on the left side of the screen, where you can toggle them. F-strings are recommended for automatically generating object names
- Use "/" inside names for example `image/0` to create nested trees.
- For convenience, we accept numpy arrays, torch Tensors, and lists in general for any arguments marked at `np.ndarray` (by default torch is not imported to avoid having it as a dependency).
- For convenience, we accept numpy arrays, torch Tensors, and lists in general for any arguments marked at `np.ndarray` (by default torch is not imported to avoid having it as a dependency).
- The initial camera pose will be automatically determined. Pass `center=[x, y, z]` (camera position) ,
`origin=[x,y,z]` (camera target), `forward=[x,y,z]` (forward vector), `world_up=[x,y,z]` (world space up vector) to display() or export() or embed() to manually set an initial pose.
`origin=[x,y,z]` (camera target), `forward=[x,y,z]` (forward vector), `world_up=[x,y,z]` (world space up vector) to display() or export() or embed() to manually set an initial pose.
A convenience function `scene.set_opencv()` is given to set the world up axis to `-y` (this also changes the default behavior of `add_image`).
- Use `scene.export("path")` to manually generate a directory you can open in the browser or upload somewhere

Expand Down Expand Up @@ -101,7 +101,7 @@ from nerfvis import scene
import numpy as np

# Set -y up world, and also flips the image
scene.set_opencv()
scene.set_opencv()

# Example data
f = 1111.0
Expand All @@ -123,10 +123,12 @@ scene.add_camera_frustum("cameras", r=c2ws[:, :3, :3], t=c2ws[:, :3, 3], focal_l
for i in range(len(c2ws)):
scene.add_image(
f"images/i",
images[i],
images[i], # Can be path too
r=c2ws[i, :3, :3], t=c2ws[i, :3, 3],
focal_length=f,
z=0.5,
# NOTE: this image size is the display image size not original imge size
# (that will be taken from the image). Keep it low if you are adding many images
image_size=64)
scene.add_axes()
scene.display()
Expand Down Expand Up @@ -167,7 +169,7 @@ right now. You may programmatically generate this. They will show up in the *lay
Please also `pip install torch svox tqdm scipy` for adding NeRF (`set_nerf`)
or `pip install trimesh` for using `add_mesh_from_file(path)`.

To add cameras (also used for scaling scene, initializing camera etc), use
To add cameras (also used for scaling scene, initializing camera etc), use
`add_camera_frustum(focal_length=.., image_width=.., image_height=.., z=.., r=.., t=..)`

## Viewer Controls
Expand Down

0 comments on commit 218e26f

Please sign in to comment.