From e2531ecf3512b2a0284931734044f10309b77a9a Mon Sep 17 00:00:00 2001 From: Shaohui Liu Date: Tue, 7 Jan 2025 10:46:56 +0100 Subject: [PATCH] Tag numpy 1.26.4 to be compatible with Open3D. Support Python 3.11 (#114) * fix open3d issue * support python 3.11 due to open3d upgrade * format * back compatibility for python 3.8 --------- Co-authored-by: Yifan Yu --- .github/workflows/build.yml | 1 + README.md | 2 +- limap/visualize/vis_lines.py | 8 +++++--- requirements.txt | 4 ++-- setup.py | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc56c074..6fecef17 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,7 @@ jobs: {os: ubuntu-latest, python-version: "3.8"}, {os: ubuntu-latest, python-version: "3.9"}, {os: ubuntu-latest, python-version: "3.10"}, + {os: ubuntu-latest, python-version: "3.11"}, ] env: COMPILER_CACHE_VERSION: 1 diff --git a/README.md b/README.md index 365f0835..97b9bc66 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ In this project, we provide interfaces for various geometric operations on 2D/3D ## Installation **Install the dependencies as follows:** -* Python 3.8/9/10 +* Python 3.8/9/10/11 * CMake >= 3.17 * CUDA (for deep learning based detectors/matchers) * System dependencies [[Command line](./misc/install/dependencies.md)] diff --git a/limap/visualize/vis_lines.py b/limap/visualize/vis_lines.py index 67e41e8d..3d548a4c 100644 --- a/limap/visualize/vis_lines.py +++ b/limap/visualize/vis_lines.py @@ -85,9 +85,11 @@ def open3d_get_line_set(lines, color=None, ranges=None, scale=1.0): counter += 1 o3d_colors.append(color) line_set = o3d.geometry.LineSet() - line_set.points = o3d.utility.Vector3dVector(o3d_points) - line_set.lines = o3d.utility.Vector2iVector(o3d_lines) - line_set.colors = o3d.utility.Vector3dVector(o3d_colors) + line_set.points = o3d.utility.Vector3dVector(np.array(o3d_points)) + line_set.lines = o3d.utility.Vector2iVector( + np.array(o3d_lines).astype(np.int32) + ) + line_set.colors = o3d.utility.Vector3dVector(np.array(o3d_colors)) return line_set diff --git a/requirements.txt b/requirements.txt index 632919ba..96728ceb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,6 @@ pyyaml tqdm attrdict h5py -numpy scipy matplotlib seaborn @@ -16,11 +15,12 @@ pyvista omegaconf plyfile pathlib -open3d==0.16.0 imagesize einops ninja yacs +numpy<=1.26.4 # Tag numpy 1.26.4 for Open3D issue (https://github.com/numpy/numpy/issues/26853) +open3d==0.18.0 pycolmap>=3.11.1 ruff==0.6.7 clang-format==19.1.0 diff --git a/setup.py b/setup.py index 6e18b89a..1ea0e7d4 100644 --- a/setup.py +++ b/setup.py @@ -69,7 +69,7 @@ def build_extension(self, ext): name="limap", version="1.0.0", packages=find_packages(), - python_requires=">=3.8, < 3.11", + python_requires=">=3.8, < 3.12", author="Shaohui Liu", author_email="b1ueber2y@gmail.com", description="A toolbox for mapping and localization with line features",