From 2d4cf84947fb05873888e5b35c6d573fbb4e600e Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Thu, 12 Dec 2024 17:40:10 +0100 Subject: [PATCH 1/6] update temporary hloc upstream --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5cd592b..496ec8d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,4 +28,4 @@ clang-format==19.1.0 pytlsd@git+https://github.com/iago-suarez/pytlsd.git@37ac583 deeplsd@git+https://github.com/cvg/DeepLSD.git@88c589d gluestick@git+https://github.com/cvg/GlueStick.git@0f28efd --e git+https://github.com/cvg/Hierarchical-Localization.git@abb2520#egg=hloc +-e git+https://github.com/B1ueber2y/Hierarchical-Localization.git@1d14d71#egg=hloc From 7f0f75c998dfa047ba1cdb92ebc9208792480463 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Thu, 12 Dec 2024 17:40:25 +0100 Subject: [PATCH 2/6] fix convention --- limap/runners/hybrid_localization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/limap/runners/hybrid_localization.py b/limap/runners/hybrid_localization.py index 3fd617b..b854c50 100644 --- a/limap/runners/hybrid_localization.py +++ b/limap/runners/hybrid_localization.py @@ -81,7 +81,7 @@ def get_hloc_keypoints_from_log( p2ds = logs["loc"][query_img_name]["keypoints_query"] p3d_ids = logs["loc"][query_img_name]["points3D_ids"] p3ds = [ref_sfm.points3D[j].xyz for j in p3d_ids] - inliers = logs["loc"][query_img_name]["PnP_ret"]["inliers"] + inliers = logs["loc"][query_img_name]["PnP_ret"]["inlier_mask"] p2ds, p3ds = np.array(p2ds), np.array(p3ds) if resize_scales is not None and query_img_name in resize_scales: From 087e79403b7f17e9ce05f4738d05d0799a2559a5 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Thu, 12 Dec 2024 17:43:37 +0100 Subject: [PATCH 3/6] fix docs --- limap/estimators/absolute_pose/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/limap/estimators/absolute_pose/__init__.py b/limap/estimators/absolute_pose/__init__.py index dd94a73..488b270 100644 --- a/limap/estimators/absolute_pose/__init__.py +++ b/limap/estimators/absolute_pose/__init__.py @@ -37,10 +37,10 @@ def pl_estimate_absolute_pose( campose (:class:`limap.base.CameraPose`, optional): \ Initial camera pose, only useful for pose refinement \ (when ``cfg["ransac"]["method"]`` is :py:obj:`None`) - inliers_line (list[int], optional): \ - Indices of line inliers, only useful for pose refinement - inliers_point (list[int], optional): \ - Indices of point inliers, only useful for pose refinement + inliers_line (:class:`np.array`, optional): \ + Boolean mask of line inliers, only useful for pose refinement + inliers_point (:class:`np.array`, optional): \ + Boolean mask of point inliers, only useful for pose refinement jointloc_cfg (dict, optional): Config for joint optimization, \ fields refer to :class:`limap.optimize.LineLocConfig`, \ pass :py:obj:`None` for default From 051d495c43a2747402a7b6a5a74203a0bdecc4e6 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Thu, 12 Dec 2024 18:42:29 +0100 Subject: [PATCH 4/6] minor --- limap/base/bindings.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/limap/base/bindings.cc b/limap/base/bindings.cc index 55a1b0e..9266cf7 100644 --- a/limap/base/bindings.cc +++ b/limap/base/bindings.cc @@ -687,7 +687,7 @@ void bind_line_linker(py::module &m) { void bind_camera(py::module &m) { // TODO: use pycolmap - py::enum_ PyCameraModelId(m, "CameraModelId"); + py::enum_ PyCameraModelId(m, "CameraModelId", py::module_local()); PyCameraModelId.value("INVALID", colmap::CameraModelId::kInvalid); PyCameraModelId.value("SIMPLE_PINHOLE", colmap::CameraModelId::kSimplePinhole); From 2fafdf62a1f99ccf06f25a5fa377e58dd0dd2d5f Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Thu, 12 Dec 2024 18:57:53 +0100 Subject: [PATCH 5/6] format --- limap/base/bindings.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/limap/base/bindings.cc b/limap/base/bindings.cc index 9266cf7..f404b60 100644 --- a/limap/base/bindings.cc +++ b/limap/base/bindings.cc @@ -687,7 +687,8 @@ void bind_line_linker(py::module &m) { void bind_camera(py::module &m) { // TODO: use pycolmap - py::enum_ PyCameraModelId(m, "CameraModelId", py::module_local()); + py::enum_ PyCameraModelId(m, "CameraModelId", + py::module_local()); PyCameraModelId.value("INVALID", colmap::CameraModelId::kInvalid); PyCameraModelId.value("SIMPLE_PINHOLE", colmap::CameraModelId::kSimplePinhole); From 8b6d5bc9ddf2d4ce0415c1d96ea0c524cd962b1c Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Thu, 12 Dec 2024 21:17:55 +0100 Subject: [PATCH 6/6] bugfix --- limap/estimators/absolute_pose/joint_pose_estimator.cc | 2 +- limap/optimize/hybrid_localization/hybrid_localization.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/limap/estimators/absolute_pose/joint_pose_estimator.cc b/limap/estimators/absolute_pose/joint_pose_estimator.cc index 544ce1b..53e2343 100644 --- a/limap/estimators/absolute_pose/joint_pose_estimator.cc +++ b/limap/estimators/absolute_pose/joint_pose_estimator.cc @@ -69,7 +69,7 @@ JointPoseEstimator::JointPoseEstimator( l2ds_ = &l2ds; p3ds_ = &p3ds; p2ds_ = &p2ds; - cam_ = Camera(cam.K()); + cam_ = Camera("PINHOLE", cam.K()); num_data_ = p3ds.size() + l3d_ids.size(); if (loc_config_.cost_function == E3DLineLineDist2 || diff --git a/limap/optimize/hybrid_localization/hybrid_localization.h b/limap/optimize/hybrid_localization/hybrid_localization.h index af8e7ba..53e62f2 100644 --- a/limap/optimize/hybrid_localization/hybrid_localization.h +++ b/limap/optimize/hybrid_localization/hybrid_localization.h @@ -46,7 +46,7 @@ class LineLocEngine { CHECK_EQ(l3ds.size(), l2ds.size()); this->l3ds = l3ds; this->l2ds = l2ds; - this->cam = Camera(K); + this->cam = Camera("PINHOLE", K); this->campose = CameraPose(R, T); } void Initialize(const std::vector &l3ds, @@ -60,7 +60,7 @@ class LineLocEngine { K(1, 1) = kvec(1); K(0, 2) = kvec(2); K(1, 2) = kvec(3); - this->cam = Camera(K); + this->cam = Camera("PINHOLE", K); this->campose = CameraPose(qvec, tvec); } void SetUp(); @@ -103,7 +103,7 @@ class JointLocEngine : public LineLocEngine { this->p2ds = p2ds; this->l3ds = l3ds; this->l2ds = l2ds; - this->cam = Camera(K); + this->cam = Camera("PINHOLE", K); this->campose = CameraPose(R, T); } void Initialize(const std::vector &l3ds, @@ -121,7 +121,7 @@ class JointLocEngine : public LineLocEngine { K(1, 1) = kvec(1); K(0, 2) = kvec(2); K(1, 2) = kvec(3); - this->cam = Camera(K); + this->cam = Camera("PINHOLE", K); this->campose = CameraPose(qvec, tvec); } };