ahojnnes ยท GitHub

@ahojnnes

@ahojnnes

@ahojnnes

@gemini-code-assist

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the performance of PatchMatchStereo by parallelizing the previously single-threaded input reading and image resizing operations. By introducing a dedicated I/O thread pool and enhancing thread safety within the caching mechanism, the system can now process inputs more efficiently. A new user-configurable option provides control over the level of parallelism.

Highlights

  • Parallel Input Reading: Implemented parallel loading and resizing of images, depth maps, and normal maps in PatchMatchStereo using a dedicated I/O thread pool to address performance bottlenecks.
  • Thread Safety: Introduced mutex locks in the CachedWorkspace to ensure thread-safe access and updates to the image cache during parallel operations.
  • Configuration Option: Added a new num_threads option for PatchMatchStereo, allowing users to specify the number of threads for parallel processing, with -1 defaulting to all available threads.
Changelog
  • src/colmap/controllers/option_manager.cc
    • Added the PatchMatchStereo.num_threads option to the option manager.
  • src/colmap/mvs/patch_match.cc
    • Included the threading.h header.
    • Initialized a new io_thread_pool_ for parallel I/O operations.
    • Refactored image, depth map, and normal map reading to utilize the io_thread_pool_ for asynchronous processing.
  • src/colmap/mvs/patch_match.h
    • Declared io_thread_pool_ as a member of PatchMatchController.
  • src/colmap/mvs/patch_match_options.cc
    • Updated the Print() method to include num_threads.
    • Added a check for num_threads to ensure it is greater than or equal to -1.
  • src/colmap/mvs/patch_match_options.h
    • Added num_threads member to PatchMatchOptions with a default value of -1.
  • src/colmap/mvs/workspace.cc
    • Applied std::lock_guard around cache_.Get and cache_.UpdateNumBytes calls in GetBitmap, GetDepthMap, and GetNormalMap for thread safety.
  • src/colmap/mvs/workspace.h
    • Added cache_mutex_ to CachedWorkspace for protecting cache access.
  • src/colmap/ui/dense_reconstruction_widget.cc
    • Integrated the num_threads option into the dense reconstruction UI.
  • src/pycolmap/pipeline/mvs.cc
    • Exposed the num_threads option to the Python bindings for PatchMatchStereo.
Activity
  • The author 'ahojnnes' created this pull request to improve performance by parallelizing input reading in PatchMatchStereo.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with ๐Ÿ‘ and ๐Ÿ‘Ž on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. โ†ฉ

gemini-code-assist[bot]

@ahojnnes

gemini-code-assist[bot]

@ahojnnes

ahojnnes marked this pull request as ready for review

February 27, 2026 18:07

@ahojnnes

B1ueber2y

@ahojnnes

@ahojnnes

@ahojnnes

@ahojnnes

ahojnnes deleted the user/jsch/parallel-input-loading-patch-match branch

February 28, 2026 20:00

Read the original on github.com โ†—