From 74621bc179990e126b02c8813268c4bfe2f222ef Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 13:15:15 +0100 Subject: [PATCH 01/27] Support Mac OS in CI. --- .github/workflows/build-mac.yml | 96 +++++++++++++++++++ .../workflows/{build.yml => build-ubuntu.yml} | 1 - 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-mac.yml rename .github/workflows/{build.yml => build-ubuntu.yml} (98%) diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml new file mode 100644 index 00000000..2152c700 --- /dev/null +++ b/.github/workflows/build-mac.yml @@ -0,0 +1,96 @@ +name: limap + +on: + push: + branches: + - main + - release/* + pull_request: + types: [ assigned, opened, synchronize, reopened ] + release: + types: [ published, edited ] + +jobs: + build: + name: ${{ matrix.config.os }} ${{ matrix.config.arch }} with Python ${{ matrix.config.python-version }} + runs-on: ${{ matrix.config.os }} + strategy: + fail-fast: false + matrix: + config: [ + {os: macos-14, arch: arm64, python-version: "3.9"}, + {os: macos-14, arch: arm64, python-version: "3.10"}, + {os: macos-14, arch: arm64, python-version: "3.11"}, + ] + env: + COMPILER_CACHE_VERSION: 1 + COMPILER_CACHE_DIR: ${{ github.workspace }}/compiler-cache + CCACHE_DIR: ${{ github.workspace }}/compiler-cache/ccache + CCACHE_BASEDIR: ${{ github.workspace }} + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + id: cache-builds + with: + key: limap-v${{ env.COMPILER_CACHE_VERSION }}-${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.run_id }}-${{ github.run_number }} + restore-keys: limap-v${{ env.COMPILER_CACHE_VERSION }}-${{ matrix.config.os }}-${{ matrix.config.arch }} + path: ${{ env.COMPILER_CACHE_DIR }} + + - name: Setup Mac + run: | + # Fix `brew link` error. + find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete + + brew install \ + cmake \ + ninja \ + boost \ + eigen \ + flann \ + freeimage \ + metis \ + glog \ + googletest \ + ceres-solver \ + qt5 \ + glew \ + cgal \ + sqlite3 \ + ccache \ + hdf5 + + - name: Set up Python ${{ matrix.config.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.config.python-version }} + + - name: Install Python dependencies + run: | + git submodule update --init --recursive + python -m pip install --upgrade pip + python -m pip install setuptools + python -m pip install -r requirements.txt + + - name: Build + run: python -m pip install -v . + + - name: Run Python tests + run: python -c "import limap; print(limap.__version__)" + + - name: Run tests + run: | + pytest -m ci_workflow tests + + + - name: Run localization test + run: | + python runners/tests/localization.py + + - name: Run E2E tests + run: | + bash scripts/quickstart.sh + python runners/hypersim/fitnmerge.py --default_config_file cfgs/fitnmerge/default_cpu.yaml \ + --output_dir outputs/quickstart_test --visualize 0 + python runners/hypersim/triangulation.py --default_config_file cfgs/triangulation/default_fast.yaml \ + --output_dir outputs/quickstart_test --triangulation.use_exhaustive_matcher --skip_exists --visualize 0 + diff --git a/.github/workflows/build.yml b/.github/workflows/build-ubuntu.yml similarity index 98% rename from .github/workflows/build.yml rename to .github/workflows/build-ubuntu.yml index 0ffbdf8d..73367164 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build-ubuntu.yml @@ -37,7 +37,6 @@ jobs: path: ${{ env.COMPILER_CACHE_DIR }} - name: Set env (Linux) - if: runner.os == 'Linux' run: | sudo apt-get update && sudo apt-get install -y \ git \ From ec3ddbcb3ceb6224e29a0c6bd1b038efaddd39d7 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 15:37:14 +0100 Subject: [PATCH 02/27] configure qt5 --- .github/workflows/build-mac.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index 2152c700..ea293504 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -72,7 +72,9 @@ jobs: python -m pip install -r requirements.txt - name: Build - run: python -m pip install -v . + run: | + export PATH="/usr/local/opt/qt@5/bin:$PATH" + DCMAKE_PREFIX_PATH="${brew --prefix qt@5}" python -m pip install -v . - name: Run Python tests run: python -c "import limap; print(limap.__version__)" From 163e268ec977beda89739b1d3063b233972dc4a1 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 16:00:32 +0100 Subject: [PATCH 03/27] try --- .github/workflows/build-mac.yml | 4 ++-- .github/workflows/build-ubuntu.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index ea293504..ec4ef2ad 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -60,7 +60,7 @@ jobs: hdf5 - name: Set up Python ${{ matrix.config.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.config.python-version }} @@ -74,7 +74,7 @@ jobs: - name: Build run: | export PATH="/usr/local/opt/qt@5/bin:$PATH" - DCMAKE_PREFIX_PATH="${brew --prefix qt@5}" python -m pip install -v . + python -m pip install -v . - name: Run Python tests run: python -c "import limap; print(limap.__version__)" diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 73367164..0ff6c317 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -65,7 +65,7 @@ jobs: xvfb - name: Set up Python ${{ matrix.config.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.config.python-version }} From 9fa3a4d7f4f1c91ba93556a1621cbb87b72878ce Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 16:21:22 +0100 Subject: [PATCH 04/27] try --- .github/workflows/build-mac.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index ec4ef2ad..2ac6276f 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -74,6 +74,7 @@ jobs: - name: Build run: | export PATH="/usr/local/opt/qt@5/bin:$PATH" + export DCMAKE_PREFIX_PATH="$(brew --prefix qt@5)" python -m pip install -v . - name: Run Python tests From da94899047e0e8a50a665c476c94c15058dd735c Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 16:27:57 +0100 Subject: [PATCH 05/27] try --- .github/workflows/build-mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index 2ac6276f..5bf22111 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -73,7 +73,7 @@ jobs: - name: Build run: | - export PATH="/usr/local/opt/qt@5/bin:$PATH" + export PATH="/usr/homebrew/opt/qt@5/bin:$PATH" export DCMAKE_PREFIX_PATH="$(brew --prefix qt@5)" python -m pip install -v . From 81129a9ef7281dafbf36680a8a71a50effcd12f0 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 16:34:14 +0100 Subject: [PATCH 06/27] update --- .github/workflows/build-mac.yml | 6 +++++- .github/workflows/build-ubuntu.yml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index 5bf22111..00b9e053 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -1,4 +1,8 @@ -name: limap +name: limap (Mac) + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} on: push: diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 0ff6c317..a45be18a 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -1,4 +1,8 @@ -name: limap +name: limap (Ubuntu) + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} on: push: From 98377f702fde9e43959af768aadef4f8eab69126 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 16:43:47 +0100 Subject: [PATCH 07/27] try --- .github/workflows/build-mac.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index 00b9e053..a3c5d41d 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -63,6 +63,10 @@ jobs: ccache \ hdf5 + export LDFLAGS="-L/opt/homebrew/opt/qt@5/lib" + export CPPFLAGS="-I/opt/homebrew/opt/qt@5/include" + export PATH="/usr/homebrew/opt/qt@5/bin:$PATH" + - name: Set up Python ${{ matrix.config.python-version }} uses: actions/setup-python@v5 with: @@ -77,8 +81,6 @@ jobs: - name: Build run: | - export PATH="/usr/homebrew/opt/qt@5/bin:$PATH" - export DCMAKE_PREFIX_PATH="$(brew --prefix qt@5)" python -m pip install -v . - name: Run Python tests From 390564281f5d518b389f2f29e3124bf95149621e Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 16:51:30 +0100 Subject: [PATCH 08/27] try --- cmake/FindDependencies.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/FindDependencies.cmake b/cmake/FindDependencies.cmake index 75a05875..af738fd8 100644 --- a/cmake/FindDependencies.cmake +++ b/cmake/FindDependencies.cmake @@ -54,6 +54,7 @@ endif() message(STATUS "Configuring PoseLib... done") # COLMAP +set(GUI_ENABLED OFF) FetchContent_Declare(COLMAP GIT_REPOSITORY https://github.com/colmap/colmap.git GIT_TAG c9097b031ee00da22609c7ac4b3f6b45b4178de2 From b749befd59924207261a01727ce8a8166058c052 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 16:52:20 +0100 Subject: [PATCH 09/27] try --- cmake/FindDependencies.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindDependencies.cmake b/cmake/FindDependencies.cmake index af738fd8..55547f23 100644 --- a/cmake/FindDependencies.cmake +++ b/cmake/FindDependencies.cmake @@ -54,7 +54,7 @@ endif() message(STATUS "Configuring PoseLib... done") # COLMAP -set(GUI_ENABLED OFF) +set(GUI_ENABLED OFF CACHE BOOL "Disable GUI" FORCE) FetchContent_Declare(COLMAP GIT_REPOSITORY https://github.com/colmap/colmap.git GIT_TAG c9097b031ee00da22609c7ac4b3f6b45b4178de2 From c65fdb811b5460af66dbce587bcee652c0af36b9 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 17:09:54 +0100 Subject: [PATCH 10/27] fix some warnings --- cmake/FindDependencies.cmake | 1 + limap/base/camera.h | 9 ++++----- limap/base/line_dists.cc | 4 ++++ limap/util/simple_logger.h | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cmake/FindDependencies.cmake b/cmake/FindDependencies.cmake index 55547f23..9f43d8b1 100644 --- a/cmake/FindDependencies.cmake +++ b/cmake/FindDependencies.cmake @@ -55,6 +55,7 @@ message(STATUS "Configuring PoseLib... done") # COLMAP set(GUI_ENABLED OFF CACHE BOOL "Disable GUI" FORCE) +set(LSD_ENABLED OFF CACHE BOOL "Disable LSD in COLMAP" FORCE) FetchContent_Declare(COLMAP GIT_REPOSITORY https://github.com/colmap/colmap.git GIT_TAG c9097b031ee00da22609c7ac4b3f6b45b4178de2 diff --git a/limap/base/camera.h b/limap/base/camera.h index ac8a29dd..04199398 100644 --- a/limap/base/camera.h +++ b/limap/base/camera.h @@ -87,11 +87,10 @@ class Camera : public colmap::Camera { class CameraPose { public: - CameraPose(bool initialized = false) : initialized(initialized) {} - CameraPose(V4D qvec, V3D tvec, bool initialized = true) - : qvec(qvec.normalized()), tvec(tvec), initialized(initialized) {} - CameraPose(M3D R, V3D T, bool initiallized = true) - : tvec(T), initialized(initialized) { + CameraPose(bool init = false) : initialized(init) {} + CameraPose(V4D qvec, V3D tvec, bool init = true) + : qvec(qvec.normalized()), tvec(tvec), initialized(init) {} + CameraPose(M3D R, V3D T, bool init = true) : tvec(T), initialized(init) { qvec = RotationMatrixToQuaternion(R); } CameraPose(py::dict dict); diff --git a/limap/base/line_dists.cc b/limap/base/line_dists.cc index ee76d014..ab771346 100644 --- a/limap/base/line_dists.cc +++ b/limap/base/line_dists.cc @@ -218,6 +218,8 @@ double compute_distance(const Line2d &l1, const Line2d &l2, case LineDistType::ENDPOINTS_SCALEINV: throw std::runtime_error( "Type error. Scale invariance distance is not supported for Line2d."); + default: + throw std::runtime_error("Distance type not supported."); } return -1.0; } @@ -260,6 +262,8 @@ double compute_distance(const Line3d &l1, const Line3d &l2, return dist_endpoints_scaleinv_oneway(l1, l2); case LineDistType::ENDPOINTS_SCALEINV: return dist_endpoints_scaleinv(l1, l2); + default: + throw std::runtime_error("Distance type not supported."); } return -1.0; } diff --git a/limap/util/simple_logger.h b/limap/util/simple_logger.h index f150b6ec..4051a1ba 100644 --- a/limap/util/simple_logger.h +++ b/limap/util/simple_logger.h @@ -170,7 +170,7 @@ class LogProgressbar : public progressbar { if (update_is_called) progress += inc; std::string out = get_update_str(); - if (out.c_str() != "\r") { + if (out != "\r") { STDLOG(CERR) << out; } } @@ -189,7 +189,7 @@ class SyncLogProgressbar : public progressbar { if (update_is_called) progress += inc; std::string out = get_update_str(); - if (out.c_str() != "\r") { + if (out != "\r") { SYNC_LOG(CERR) << out; } } From 468bf10a593aa4aa8b288f64441ccb7252fdff05 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 17:12:19 +0100 Subject: [PATCH 11/27] remove qt. add hdf5 support --- .github/workflows/build-mac.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index a3c5d41d..e4a4cc0b 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -56,17 +56,12 @@ jobs: glog \ googletest \ ceres-solver \ - qt5 \ glew \ cgal \ sqlite3 \ ccache \ hdf5 - export LDFLAGS="-L/opt/homebrew/opt/qt@5/lib" - export CPPFLAGS="-I/opt/homebrew/opt/qt@5/include" - export PATH="/usr/homebrew/opt/qt@5/bin:$PATH" - - name: Set up Python ${{ matrix.config.python-version }} uses: actions/setup-python@v5 with: @@ -81,6 +76,8 @@ jobs: - name: Build run: | + + export CMAKE_PREFIX_PATH=$(brew --prefix hdf5):$CMAKE_PREFIX_PATH python -m pip install -v . - name: Run Python tests From 9680e35b42e75f3430f53d136c988a4ef75213f7 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 17:20:37 +0100 Subject: [PATCH 12/27] update jlinkage token. --- cmake/FindDependencies.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindDependencies.cmake b/cmake/FindDependencies.cmake index 9f43d8b1..61e72f92 100644 --- a/cmake/FindDependencies.cmake +++ b/cmake/FindDependencies.cmake @@ -72,7 +72,7 @@ message(STATUS "Configuring COLMAP... done") # JLinkage FetchContent_Declare(JLinkage GIT_REPOSITORY https://github.com/B1ueber2y/JLinkage.git - GIT_TAG 452d67eda005db01a02071a5af8f0eced0a02079 + GIT_TAG 75dadd555f81b1cf1b0f016d8cac76f3b554ba9b EXCLUDE_FROM_ALL ) message(STATUS "Configuring JLinkage...") From 4659cb528021857cf2d59c20563d0e08076461e6 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 17:26:17 +0100 Subject: [PATCH 13/27] Upgrade highfive. --- .gitmodules | 6 +++--- third-party/CMakeLists.txt | 2 +- third-party/HighFive | 1 - third-party/highfive | 1 + 4 files changed, 5 insertions(+), 5 deletions(-) delete mode 160000 third-party/HighFive create mode 160000 third-party/highfive diff --git a/.gitmodules b/.gitmodules index 7344c97b..5716de77 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,9 +5,9 @@ path = third-party/RansacLib url = https://github.com/B1ueber2y/RansacLib.git branch = header-only -[submodule "third-party/HighFive"] - path = third-party/HighFive - url = https://github.com/B1ueber2y/HighFive.git [submodule "third-party/libigl"] path = third-party/libigl url = https://github.com/libigl/libigl.git +[submodule "third-party/highfive"] + path = third-party/highfive + url = git@github.com:highfive-devs/highfive.git diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index 122e191d..8060962d 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -1,4 +1,4 @@ -add_subdirectory(HighFive) +add_subdirectory(highfive) add_subdirectory(pybind11) add_subdirectory(libigl) add_subdirectory(RansacLib) diff --git a/third-party/HighFive b/third-party/HighFive deleted file mode 160000 index 5e77ac37..00000000 --- a/third-party/HighFive +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5e77ac375928e339a8d43b39a122c28167a64dc1 diff --git a/third-party/highfive b/third-party/highfive new file mode 160000 index 00000000..452082ec --- /dev/null +++ b/third-party/highfive @@ -0,0 +1 @@ +Subproject commit 452082ece5857aac93e079f14c7b19f1c5d17698 From 5811a2c6451c77a88f1ad374c5a1afea67a076a3 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 17:35:53 +0100 Subject: [PATCH 14/27] change git to https --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 5716de77..bbb5235f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,4 +10,4 @@ url = https://github.com/libigl/libigl.git [submodule "third-party/highfive"] path = third-party/highfive - url = git@github.com:highfive-devs/highfive.git + url = https://github.com/highfive-devs/highfive.git From 8bbfdfab8196881ffa2d50c32e76f9cb6f7244c7 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 17:54:51 +0100 Subject: [PATCH 15/27] try --- .github/workflows/build-mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index e4a4cc0b..6955a930 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -76,7 +76,7 @@ jobs: - name: Build run: | - + export HDF5_ROOT=$(brew --prefix hdf5) export CMAKE_PREFIX_PATH=$(brew --prefix hdf5):$CMAKE_PREFIX_PATH python -m pip install -v . From 411596f14984e16c3e06cc605d65093740103f7c Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 17:57:27 +0100 Subject: [PATCH 16/27] try --- .github/workflows/build-mac.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index 6955a930..5a1dcd80 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -1,8 +1,8 @@ name: limap (Mac) -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} +# concurrency: +# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} +# cancel-in-progress: ${{ github.event_name == 'pull_request' }} on: push: @@ -60,7 +60,7 @@ jobs: cgal \ sqlite3 \ ccache \ - hdf5 + hdf5@1.10 - name: Set up Python ${{ matrix.config.python-version }} uses: actions/setup-python@v5 From c39bc1da7e915c9b0046ec9d01f8b008b5e0f48d Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 18:08:40 +0100 Subject: [PATCH 17/27] revert --- .github/workflows/build-mac.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index 5a1dcd80..bd63d787 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -1,8 +1,8 @@ name: limap (Mac) -# concurrency: -# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} -# cancel-in-progress: ${{ github.event_name == 'pull_request' }} +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} on: push: @@ -60,7 +60,7 @@ jobs: cgal \ sqlite3 \ ccache \ - hdf5@1.10 + hdf5 - name: Set up Python ${{ matrix.config.python-version }} uses: actions/setup-python@v5 @@ -76,8 +76,6 @@ jobs: - name: Build run: | - export HDF5_ROOT=$(brew --prefix hdf5) - export CMAKE_PREFIX_PATH=$(brew --prefix hdf5):$CMAKE_PREFIX_PATH python -m pip install -v . - name: Run Python tests From 71b8e5aa6df641c7dbd727925df9117c0b1d8e74 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 18:27:33 +0100 Subject: [PATCH 18/27] revert python setup --- .github/workflows/build-mac.yml | 2 +- .github/workflows/build-ubuntu.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index bd63d787..08679e8f 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -63,7 +63,7 @@ jobs: hdf5 - name: Set up Python ${{ matrix.config.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.config.python-version }} diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index a45be18a..98bb5302 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -69,7 +69,7 @@ jobs: xvfb - name: Set up Python ${{ matrix.config.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.config.python-version }} From 9a90085656dc3f994f88a99eee5a6492f6251b3a Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 21:33:44 +0100 Subject: [PATCH 19/27] update --- limap/base/bindings.cc | 6 +++--- limap/base/camera.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/limap/base/bindings.cc b/limap/base/bindings.cc index 102d6a8f..c1513b8a 100644 --- a/limap/base/bindings.cc +++ b/limap/base/bindings.cc @@ -804,7 +804,7 @@ void bind_camera(py::module &m) { .def(py::init(), R"( Default constructor: identity pose )", - py::arg("initialized") = false) + py::arg("init") = false) .def(py::init(), R"( Copy constructor )", @@ -812,11 +812,11 @@ void bind_camera(py::module &m) { .def(py::init(), R"( Constructor from a quaternion vector and a translation vector )", - py::arg("qvec"), py::arg("tvec"), py::arg("initialized") = true) + py::arg("qvec"), py::arg("tvec"), py::arg("init") = true) .def(py::init(), R"( Constructor from a rotation matrix and a translation vector )", - py::arg("R"), py::arg("tvec"), py::arg("initialized") = true) + py::arg("R"), py::arg("tvec"), py::arg("init") = true) .def(py::init(), R"( Constructor from a Python dict )", diff --git a/limap/base/camera.h b/limap/base/camera.h index 04199398..b60a506e 100644 --- a/limap/base/camera.h +++ b/limap/base/camera.h @@ -90,7 +90,7 @@ class CameraPose { CameraPose(bool init = false) : initialized(init) {} CameraPose(V4D qvec, V3D tvec, bool init = true) : qvec(qvec.normalized()), tvec(tvec), initialized(init) {} - CameraPose(M3D R, V3D T, bool init = true) : tvec(T), initialized(init) { + CameraPose(M3D R, V3D t, bool init = true) : tvec(t), initialized(init) { qvec = RotationMatrixToQuaternion(R); } CameraPose(py::dict dict); From a13b0c531d3d8e0eebd1209f551e8e4925548f95 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Mon, 17 Mar 2025 23:16:25 +0100 Subject: [PATCH 20/27] clean caching --- .github/workflows/build-mac.yml | 6 ++++++ .github/workflows/build-ubuntu.yml | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index 08679e8f..0589d61c 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -98,3 +98,9 @@ jobs: python runners/hypersim/triangulation.py --default_config_file cfgs/triangulation/default_fast.yaml \ --output_dir outputs/quickstart_test --triangulation.use_exhaustive_matcher --skip_exists --visualize 0 + - name: Cleanup compiler cache + run: | + set -x + ccache --show-stats --verbose + ccache --evict-older-than 1d + ccache --show-stats --verbose diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 98bb5302..7db2579c 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -103,3 +103,17 @@ jobs: python runners/hypersim/triangulation.py --default_config_file cfgs/triangulation/default_fast.yaml \ --output_dir outputs/quickstart_test --triangulation.use_exhaustive_matcher --skip_exists --visualize 0 + - name: Cleanup compiler cache + run: | + set -x + ccache --show-stats --verbose + ccache --evict-older-than 1d + ccache --show-stats --verbose + + echo "Size of ctcache before: $(du -sh $CTCACHE_DIR)" + echo "Number of ctcache files before: $(find $CTCACHE_DIR | wc -l)" + # Delete cache older than 10 days. + find "$CTCACHE_DIR"/*/ -mtime +10 -print0 | xargs -0 rm -rf + echo "Size of ctcache after: $(du -sh $CTCACHE_DIR)" + echo "Number of ctcache files after: $(find $CTCACHE_DIR | wc -l)" + From b2ae51993db10a07f1f89e4f827fa7005d61675d Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Tue, 18 Mar 2025 10:39:35 +0100 Subject: [PATCH 21/27] try --- .github/workflows/build-mac.yml | 5 ----- cmake/FindDependencies.cmake | 1 - 2 files changed, 6 deletions(-) diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index 0589d61c..aa8f6963 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -81,11 +81,6 @@ jobs: - name: Run Python tests run: python -c "import limap; print(limap.__version__)" - - name: Run tests - run: | - pytest -m ci_workflow tests - - - name: Run localization test run: | python runners/tests/localization.py diff --git a/cmake/FindDependencies.cmake b/cmake/FindDependencies.cmake index 61e72f92..7fa3d5dd 100644 --- a/cmake/FindDependencies.cmake +++ b/cmake/FindDependencies.cmake @@ -55,7 +55,6 @@ message(STATUS "Configuring PoseLib... done") # COLMAP set(GUI_ENABLED OFF CACHE BOOL "Disable GUI" FORCE) -set(LSD_ENABLED OFF CACHE BOOL "Disable LSD in COLMAP" FORCE) FetchContent_Declare(COLMAP GIT_REPOSITORY https://github.com/colmap/colmap.git GIT_TAG c9097b031ee00da22609c7ac4b3f6b45b4178de2 From 43e2bcb2c4e83c35ee67947e1f2c843bc00ebf33 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Tue, 18 Mar 2025 11:14:18 +0100 Subject: [PATCH 22/27] try --- cmake/FindDependencies.cmake | 1 + constraints.txt | 1 + limap/base/camera.h | 9 +++++---- requirements.txt | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 constraints.txt diff --git a/cmake/FindDependencies.cmake b/cmake/FindDependencies.cmake index 7fa3d5dd..61e72f92 100644 --- a/cmake/FindDependencies.cmake +++ b/cmake/FindDependencies.cmake @@ -55,6 +55,7 @@ message(STATUS "Configuring PoseLib... done") # COLMAP set(GUI_ENABLED OFF CACHE BOOL "Disable GUI" FORCE) +set(LSD_ENABLED OFF CACHE BOOL "Disable LSD in COLMAP" FORCE) FetchContent_Declare(COLMAP GIT_REPOSITORY https://github.com/colmap/colmap.git GIT_TAG c9097b031ee00da22609c7ac4b3f6b45b4178de2 diff --git a/constraints.txt b/constraints.txt new file mode 100644 index 00000000..b6a28289 --- /dev/null +++ b/constraints.txt @@ -0,0 +1 @@ +pycolmap --no-binary=:all: diff --git a/limap/base/camera.h b/limap/base/camera.h index b60a506e..ac8a29dd 100644 --- a/limap/base/camera.h +++ b/limap/base/camera.h @@ -87,10 +87,11 @@ class Camera : public colmap::Camera { class CameraPose { public: - CameraPose(bool init = false) : initialized(init) {} - CameraPose(V4D qvec, V3D tvec, bool init = true) - : qvec(qvec.normalized()), tvec(tvec), initialized(init) {} - CameraPose(M3D R, V3D t, bool init = true) : tvec(t), initialized(init) { + CameraPose(bool initialized = false) : initialized(initialized) {} + CameraPose(V4D qvec, V3D tvec, bool initialized = true) + : qvec(qvec.normalized()), tvec(tvec), initialized(initialized) {} + CameraPose(M3D R, V3D T, bool initiallized = true) + : tvec(T), initialized(initialized) { qvec = RotationMatrixToQuaternion(R); } CameraPose(py::dict dict); diff --git a/requirements.txt b/requirements.txt index 3129ccdd..2842b2ff 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +-c constraints.txt pyyaml tqdm attrdict From 6d5342d0f888090671181544ce4dfdedd4f82393 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Tue, 18 Mar 2025 12:33:12 +0100 Subject: [PATCH 23/27] try --- constraints.txt | 1 - requirements.txt | 1 - 2 files changed, 2 deletions(-) delete mode 100644 constraints.txt diff --git a/constraints.txt b/constraints.txt deleted file mode 100644 index b6a28289..00000000 --- a/constraints.txt +++ /dev/null @@ -1 +0,0 @@ -pycolmap --no-binary=:all: diff --git a/requirements.txt b/requirements.txt index 2842b2ff..3129ccdd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ --c constraints.txt pyyaml tqdm attrdict From 84e643ec2296057e0c015499b18fc7cbafd844ce Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Tue, 18 Mar 2025 12:55:13 +0100 Subject: [PATCH 24/27] try --- limap/util/simple_logger.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/limap/util/simple_logger.h b/limap/util/simple_logger.h index 4051a1ba..f150b6ec 100644 --- a/limap/util/simple_logger.h +++ b/limap/util/simple_logger.h @@ -170,7 +170,7 @@ class LogProgressbar : public progressbar { if (update_is_called) progress += inc; std::string out = get_update_str(); - if (out != "\r") { + if (out.c_str() != "\r") { STDLOG(CERR) << out; } } @@ -189,7 +189,7 @@ class SyncLogProgressbar : public progressbar { if (update_is_called) progress += inc; std::string out = get_update_str(); - if (out != "\r") { + if (out.c_str() != "\r") { SYNC_LOG(CERR) << out; } } From 555cf3d7283e231f605a2fad8c5b072b13d55375 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Tue, 18 Mar 2025 13:38:44 +0100 Subject: [PATCH 25/27] remove concurrency --- .github/workflows/build-mac.yml | 4 ---- .github/workflows/build-ubuntu.yml | 4 ---- 2 files changed, 8 deletions(-) diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index aa8f6963..1a764a63 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -1,9 +1,5 @@ name: limap (Mac) -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - on: push: branches: diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 7db2579c..d39cd4c4 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -1,9 +1,5 @@ name: limap (Ubuntu) -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - on: push: branches: From fd0440447496611195ade4b3fab11bc9f0183699 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Tue, 18 Mar 2025 13:52:48 +0100 Subject: [PATCH 26/27] update --- limap/base/camera.h | 9 ++++----- limap/util/simple_logger.h | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/limap/base/camera.h b/limap/base/camera.h index ac8a29dd..b60a506e 100644 --- a/limap/base/camera.h +++ b/limap/base/camera.h @@ -87,11 +87,10 @@ class Camera : public colmap::Camera { class CameraPose { public: - CameraPose(bool initialized = false) : initialized(initialized) {} - CameraPose(V4D qvec, V3D tvec, bool initialized = true) - : qvec(qvec.normalized()), tvec(tvec), initialized(initialized) {} - CameraPose(M3D R, V3D T, bool initiallized = true) - : tvec(T), initialized(initialized) { + CameraPose(bool init = false) : initialized(init) {} + CameraPose(V4D qvec, V3D tvec, bool init = true) + : qvec(qvec.normalized()), tvec(tvec), initialized(init) {} + CameraPose(M3D R, V3D t, bool init = true) : tvec(t), initialized(init) { qvec = RotationMatrixToQuaternion(R); } CameraPose(py::dict dict); diff --git a/limap/util/simple_logger.h b/limap/util/simple_logger.h index f150b6ec..4051a1ba 100644 --- a/limap/util/simple_logger.h +++ b/limap/util/simple_logger.h @@ -170,7 +170,7 @@ class LogProgressbar : public progressbar { if (update_is_called) progress += inc; std::string out = get_update_str(); - if (out.c_str() != "\r") { + if (out != "\r") { STDLOG(CERR) << out; } } @@ -189,7 +189,7 @@ class SyncLogProgressbar : public progressbar { if (update_is_called) progress += inc; std::string out = get_update_str(); - if (out.c_str() != "\r") { + if (out != "\r") { SYNC_LOG(CERR) << out; } } From deddff4d51c53f5e716b505f03dd608418a21ad8 Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Tue, 18 Mar 2025 18:59:54 +0100 Subject: [PATCH 27/27] update --- .github/workflows/build-mac.yml | 1 + cmake/FindDependencies.cmake | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index 1a764a63..b12d6164 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -52,6 +52,7 @@ jobs: glog \ googletest \ ceres-solver \ + qt5 \ glew \ cgal \ sqlite3 \ diff --git a/cmake/FindDependencies.cmake b/cmake/FindDependencies.cmake index 61e72f92..f35171a9 100644 --- a/cmake/FindDependencies.cmake +++ b/cmake/FindDependencies.cmake @@ -54,7 +54,6 @@ endif() message(STATUS "Configuring PoseLib... done") # COLMAP -set(GUI_ENABLED OFF CACHE BOOL "Disable GUI" FORCE) set(LSD_ENABLED OFF CACHE BOOL "Disable LSD in COLMAP" FORCE) FetchContent_Declare(COLMAP GIT_REPOSITORY https://github.com/colmap/colmap.git