diff --git a/pytorch3d/implicitron/tools/eval_video_trajectory.py b/pytorch3d/implicitron/tools/eval_video_trajectory.py index f46fe292..3556a305 100644 --- a/pytorch3d/implicitron/tools/eval_video_trajectory.py +++ b/pytorch3d/implicitron/tools/eval_video_trajectory.py @@ -182,10 +182,12 @@ def generate_eval_video_cameras( ) test_cameras = PerspectiveCameras( + # pyrefly: ignore [bad-argument-type] focal_length=focal_length, principal_point=principal_point, R=R, T=T, + # pyrefly: ignore [missing-attribute] device=focal_length.device, ) diff --git a/pytorch3d/ops/points_alignment.py b/pytorch3d/ops/points_alignment.py index 1ae50cdb..94db8687 100644 --- a/pytorch3d/ops/points_alignment.py +++ b/pytorch3d/ops/points_alignment.py @@ -340,8 +340,11 @@ def corresponding_points_alignment( total_weight = torch.clamp(num_points, 1) # special handling for heterogeneous point clouds and/or input weights if weights is not None: + # pyrefly: ignore [bad-index] Xc *= weights[:, :, None] + # pyrefly: ignore [bad-index] Yc *= weights[:, :, None] + # pyrefly: ignore [missing-attribute] total_weight = torch.clamp(weights.sum(1), eps) if (num_points < (dim + 1)).any(): diff --git a/pytorch3d/renderer/cameras.py b/pytorch3d/renderer/cameras.py index 16e7a496..8039f0d4 100644 --- a/pytorch3d/renderer/cameras.py +++ b/pytorch3d/renderer/cameras.py @@ -427,9 +427,11 @@ class CamerasBase(TensorProperties): if isinstance(index, tensor_types["bool"]): # LongTensor]` has no attribute `ndim`. # LongTensor]` has no attribute `shape`. + # pyrefly: ignore [missing-attribute] if index.ndim != 1 or index.shape[0] != len(self): raise ValueError( # LongTensor]` has no attribute `shape`. + # pyrefly: ignore [missing-attribute] f"Boolean index of shape {index.shape} does not match cameras" ) elif max(index) >= len(self): @@ -1790,11 +1792,13 @@ def get_ndc_to_screen_transform( image_size = torch.tensor(image_size, device=cameras.device) # pyrefly: ignore [missing-attribute] image_size = image_size.view(-1, 2) # of shape (1 or B)x2 + # pyrefly: ignore [missing-attribute] height, width = image_size.unbind(1) # For non square images, we scale the points such that smallest side # has range [-1, 1] and the largest side has range [-u, u], with u > 1. # This convention is consistent with the PyTorch3D renderer + # pyrefly: ignore [missing-attribute] scale = (image_size.min(dim=1).values - 0.0) / 2.0 K[:, 0, 0] = scale diff --git a/pytorch3d/structures/meshes.py b/pytorch3d/structures/meshes.py index 07acece0..d1f1c85e 100644 --- a/pytorch3d/structures/meshes.py +++ b/pytorch3d/structures/meshes.py @@ -510,7 +510,9 @@ class Meshes: index = index.squeeze(1) if index.numel() > 0 else index # pyrefly: ignore [missing-attribute] index = index.tolist() + # pyrefly: ignore [not-iterable] verts = [self.verts_list()[i] for i in index] + # pyrefly: ignore [not-iterable] faces = [self.faces_list()[i] for i in index] else: raise IndexError(index) diff --git a/pytorch3d/structures/pointclouds.py b/pytorch3d/structures/pointclouds.py index 53ed5a51..16505e54 100644 --- a/pytorch3d/structures/pointclouds.py +++ b/pytorch3d/structures/pointclouds.py @@ -411,10 +411,13 @@ class Pointclouds: index = index.squeeze(1) if index.numel() > 0 else index # pyrefly: ignore [missing-attribute] index = index.tolist() + # pyrefly: ignore [not-iterable] points = [self.points_list()[i] for i in index] if normals_list is not None: + # pyrefly: ignore [not-iterable] normals = [normals_list[i] for i in index] if features_list is not None: + # pyrefly: ignore [not-iterable] features = [features_list[i] for i in index] else: raise IndexError(index)