diff --git a/examples/11_colmap_visualizer.py b/examples/11_colmap_visualizer.py index f7e5f729f..9caee82c5 100644 --- a/examples/11_colmap_visualizer.py +++ b/examples/11_colmap_visualizer.py @@ -3,6 +3,7 @@ Visualize COLMAP sparse reconstruction outputs. To get demo data, see `./assets/download_colmap_garden.sh`. """ +import random import time from pathlib import Path @@ -89,7 +90,7 @@ def visualize_colmap() -> None: # Interpret the images and cameras. img_ids = [im.id for im in images.values()] - onp.random.shuffle(img_ids) + random.shuffle(img_ids) img_ids = sorted(img_ids[: gui_frames.value]) def attach_callback( diff --git a/src/viser/extras/_record3d.py b/src/viser/extras/_record3d.py index 02e4bb567..bd2a8a5fa 100644 --- a/src/viser/extras/_record3d.py +++ b/src/viser/extras/_record3d.py @@ -109,7 +109,9 @@ def get_point_cloud( img_wh = rgb.shape[:2][::-1] - grid = np.stack(np.meshgrid(range(img_wh[0]), range(img_wh[1])), 2) + 0.5 + grid = ( + np.stack(np.meshgrid(np.arange(img_wh[0]), np.arange(img_wh[1])), 2) + 0.5 + ) grid = grid * downsample_factor homo_grid = np.pad(grid[mask], ((0, 0), (0, 1)), constant_values=1)