diff --git a/opensfm/features.py b/opensfm/features.py index 26eb0c05a..15af8700f 100644 --- a/opensfm/features.py +++ b/opensfm/features.py @@ -516,6 +516,7 @@ def extract_features_hahog( uchar_scaling = 512 if config["hahog_normalize_to_uchar"]: + # pyre-fixme[16]: `int` has no attribute `clip`. desc = (uchar_scaling * desc).clip(0, 255).round() logger.debug("Found {0} points in {1}s".format(len(points), time.time() - t)) diff --git a/opensfm/io.py b/opensfm/io.py index bf72ae9f3..79119e892 100644 --- a/opensfm/io.py +++ b/opensfm/io.py @@ -1098,6 +1098,7 @@ def reconstruction_to_ply( for depth in np.linspace(0, 2, 10): p = o + depth * R[axis] s = "{} {} {} {} {} {}".format( + # pyre-fixme[16]: `int` has no attribute `__getitem__`. p[0], p[1], p[2], int(c[0]), int(c[1]), int(c[2]) ) if point_num_views: diff --git a/opensfm/multiview.py b/opensfm/multiview.py index e6f37e9c0..e164fd1f0 100644 --- a/opensfm/multiview.py +++ b/opensfm/multiview.py @@ -464,6 +464,7 @@ def R_from_homography( def project_to_rotation_matrix(A: np.ndarray) -> Optional[np.ndarray]: try: u, d, vt = np.linalg.svd(A) + # pyre-fixme[16]: Module `linalg` has no attribute `LinAlgError`. except np.linalg.linalg.LinAlgError: return None return u.dot(vt) diff --git a/opensfm/synthetic_data/synthetic_generator.py b/opensfm/synthetic_data/synthetic_generator.py index 90b3fc8da..0dd20c840 100644 --- a/opensfm/synthetic_data/synthetic_generator.py +++ b/opensfm/synthetic_data/synthetic_generator.py @@ -219,6 +219,8 @@ def _gps_dop(shot: pymap.Shot) -> float: origin = shot.pose.get_origin() if causal_gps_noise: + # pyre-fixme[61]: `perturbations_2d` is undefined, or not always + # defined. gps_perturbation = [perturbations_2d[j][i] for j in range(2)] + [0] else: gps_noise = _gps_dop(shot) diff --git a/opensfm/test/test_bundle.py b/opensfm/test/test_bundle.py index 54202da06..d3d499560 100644 --- a/opensfm/test/test_bundle.py +++ b/opensfm/test/test_bundle.py @@ -108,14 +108,27 @@ def test_bundle_projection_fixed_internals(scene_synthetic) -> None: color = g_obs["feature_color"] pt = g_obs["feature"] obs = pymap.Observation( + # pyre-fixme[6]: For 1st argument expected `str` but got `int`. pt[0], + # pyre-fixme[6]: For 1st argument expected `str` but got `int`. pt[1], + # pyre-fixme[6]: For 3rd argument expected `float` but got + # `Dict[str, typing.Any]`. g_obs["feature_scale"], + # pyre-fixme[6]: For 1st argument expected `str` but got `int`. color[0], + # pyre-fixme[6]: For 1st argument expected `str` but got `int`. color[1], + # pyre-fixme[6]: For 1st argument expected `str` but got `int`. color[2], + # pyre-fixme[6]: For 7th argument expected `int` but got + # `Dict[str, typing.Any]`. g_obs["feature_id"], + # pyre-fixme[6]: For 8th argument expected `int` but got + # `Dict[str, typing.Any]`. g_obs["feature_segmentation"], + # pyre-fixme[6]: For 9th argument expected `int` but got + # `Dict[str, typing.Any]`. g_obs["feature_instance"], ) reference.map.add_observation(shot_id, point_id, obs) diff --git a/opensfm/test/test_multiview.py b/opensfm/test/test_multiview.py index a0e6f1376..8edc8cc8b 100644 --- a/opensfm/test/test_multiview.py +++ b/opensfm/test/test_multiview.py @@ -13,12 +13,15 @@ def normalized(x: np.ndarray) -> np.ndarray: def test_motion_from_plane_homography() -> None: R = tf.random_rotation_matrix()[:3, :3] + # pyre-fixme[6]: For 1st argument expected `ndarray` but got `int`. t = normalized(2 * np.random.rand(3) - 1) + # pyre-fixme[6]: For 1st argument expected `ndarray` but got `int`. n = normalized(2 * np.random.rand(3) - 1) d = 2 * np.random.rand() - 1 scale = 2 * np.random.rand() - 1 H = scale * (d * R - np.outer(t, n)) + # pyre-fixme[6]: For 1st argument expected `ndarray` but got `int`. motions = multiview.motion_from_plane_homography(H) assert motions is not None goodness = [] diff --git a/opensfm/test/test_robust.py b/opensfm/test/test_robust.py index 6c02d71a9..1f4330b6f 100644 --- a/opensfm/test/test_robust.py +++ b/opensfm/test/test_robust.py @@ -261,6 +261,7 @@ def test_outliers_relative_pose_ransac(pairs_and_their_E) -> None: inliers_count = (1 - ratio_outliers) * len(points) assert np.isclose(len(result.inliers_indices), inliers_count, rtol=tolerance) + # pyre-fixme[61]: `expected` is undefined, or not always defined. assert np.linalg.norm(expected - result.lo_model, ord="fro") < 16e-2