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
CachedWorkspaceto ensure thread-safe access and updates to the image cache during parallel operations. - Configuration Option: Added a new
num_threadsoption for PatchMatchStereo, allowing users to specify the number of threads for parallel processing, with -1 defaulting to all available threads.
- src/colmap/controllers/option_manager.cc
- Added the
PatchMatchStereo.num_threadsoption to the option manager.
- Added the
- src/colmap/mvs/patch_match.cc
- Included the
threading.hheader. - 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.
- Included the
- src/colmap/mvs/patch_match.h
- Declared
io_thread_pool_as a member ofPatchMatchController.
- Declared
- src/colmap/mvs/patch_match_options.cc
- Updated the
Print()method to includenum_threads. - Added a check for
num_threadsto ensure it is greater than or equal to -1.
- Updated the
- src/colmap/mvs/patch_match_options.h
- Added
num_threadsmember toPatchMatchOptionswith a default value of -1.
- Added
- src/colmap/mvs/workspace.cc
- Applied
std::lock_guardaroundcache_.Getandcache_.UpdateNumBytescalls inGetBitmap,GetDepthMap, andGetNormalMapfor thread safety.
- Applied
- src/colmap/mvs/workspace.h
- Added
cache_mutex_toCachedWorkspacefor protecting cache access.
- Added
- src/colmap/ui/dense_reconstruction_widget.cc
- Integrated the
num_threadsoption into the dense reconstruction UI.
- Integrated the
- src/pycolmap/pipeline/mvs.cc
- Exposed the
num_threadsoption to the Python bindings for PatchMatchStereo.
- Exposed the
- The author 'ahojnnes' created this pull request to improve performance by parallelizing input reading in PatchMatchStereo.
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
-
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. โฉ
ahojnnes marked this pull request as ready for review
February 27, 2026 18:07