Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there an Easy Debugging Method for COLMAP within Pycolmap? #242

Closed
jytime opened this issue Jan 21, 2024 · 2 comments
Closed

Is there an Easy Debugging Method for COLMAP within Pycolmap? #242

jytime opened this issue Jan 21, 2024 · 2 comments

Comments

@jytime
Copy link

jytime commented Jan 21, 2024

Hi all,

Thanks for your great work. I am trying to build a project on top of pycolmap (and hloc). I have successfully compiled colmap 3.9.1 and pycolmap 0.5.0 from source.

As I delve deeper, I am trying to find efficient ways to debug the code. For instance, while trying to understand the process within pycolmap.verify_matches(), I traced back to EstimateTwoViewGeometry in COLMAP. To check the H_F_inlier_ratio for various runs, I added the following logging codes:

const double H_F_inlier_ratio =
    static_cast<double>(H_report_support_num_inliers) /
    F_report_support_num_inliers;
for(int i = 0; i < 100; i++) {
    LOG(INFO) << "H_F_inlier_ratio: " << H_F_inlier_ratio;
}

However, this approach requires recompiling COLMAP from source, which takes approximately 30 minutes for each modification. I am wondering if there is a more efficient way to debug the code without having to recompile COLMAP each time.
As I am relatively new to building projects with C++, I apologize if this question seems elementary. Any guidance or suggestions would be greatly appreciated.

Best Regards,
Jianyuan

@jytime
Copy link
Author

jytime commented Jan 21, 2024

Okay after using the cmake command of

cmake .. -DCMAKE_CUDA_ARCHITECTURES=80 -DCMAKE_INSTALL_PREFIX=/data/home/jianyuan/ptcolmap/dependencey/colmap/build/colmap_installed/ -DCMAKE_BUILD_TYPE=Debug -DGUI_ENABLED=OFF

and only running make -j && make install for the following modifications, the re-compiling time of colmap is reduced to under a minute. Then we need to rerun "python -m pip install -e ." for pycolmap (every time after re-compiling the C++ code of colmap), which will take around 2 minutes. Although it is still a bit long, I share the command here in case someone may also need it.

@sarlinpe
Copy link
Collaborator

Using ninja can decrease the build time further: cmake .. -GNinja [...] && ninja install

@jytime jytime closed this as completed Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants