mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-20 06:35:36 +08:00
fix notebook, box drawing (#1202)
* fix notebook * samples * run all cells * box center * try saving again * import order * cube with different sides * black * black * update metadata * fix test Co-authored-by: Katrin Schmid <kabischmid@gmail.com> Co-authored-by: Matt Tancik <tancik@berkeley.edu>
This commit is contained in:
4 files changed
+3885
-3784
No files matched your search
@@ -3,7 +3,7 @@ Test colormaps
|
||||
"""
|
||||
import torch
|
||||
|
||||
from nerfstudio.utils import colormaps
|
||||
from nerfstudio.utils import colormaps, plotly_utils
|
||||
|
||||
|
||||
def test_apply_colormap():
|
||||
@@ -37,3 +37,19 @@ def test_apply_boolean_colormap():
|
||||
assert colored_data.shape == (10, 20, 3)
|
||||
assert torch.min(colored_data) >= 0
|
||||
assert torch.max(colored_data) <= 1
|
||||
|
||||
|
||||
def test_cube_center():
|
||||
"""Test adding a cube"""
|
||||
cube = plotly_utils.get_cube(1.0, torch.Tensor([2.0, 3.0, 4.0]))
|
||||
assert cube.x[0] == 1.5
|
||||
assert cube.y[0] == 2.5
|
||||
assert cube.z[-1] == 4.5
|
||||
|
||||
|
||||
def test_aabb_center():
|
||||
"""Test adding a cube with different dsid length"""
|
||||
cube = plotly_utils.get_cube(torch.Tensor([2.0, 1.0, 3.0]))
|
||||
assert cube.x[0] == -1
|
||||
assert cube.y[0] == -0.5
|
||||
assert cube.z[-1] == 1.5
|
||||
Reference in new issue
Block a user