Skip to content

Commit

Permalink
Fix pyright errors from numpy update
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Oct 26, 2023
1 parent a49be3a commit 82ba676
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/11_colmap_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion src/viser/extras/_record3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 82ba676

Please sign in to comment.