Cherry-pick changes for 4.0.2 release#4259
Conversation
) Flagged by Gemini in #4252
## Summary
Looks like the python bindings don't pass through the `RequiresRGB()`
option from the extraction options. This causes an exception when trying
to use the ALIKED feature extractor.
```
E20260318 00:15:30.424098 938475 aliked.cc:166] Check failed: bitmap.IsRGB()
terminate called after throwing an instance of 'std::invalid_argument'
```
## Reproducing
Using colmap built from source with `-DONNX_ENABLED=ON`, this will fail
```python
from argparse import ArgumentParser
from pathlib import Path
import pycolmap
def main():
parser = ArgumentParser()
parser.add_argument("image_path")
parser.add_argument("--database-path", default="database.db")
args = parser.parse_args()
image_path = Path(args.image_path)
image_dir = image_path if image_path.is_dir() else image_path.parent
image_names = [] if image_path.is_dir() else [image_path.name]
pycolmap.extract_features(
database_path=args.database_path,
image_path=str(image_dir),
image_names=image_names,
extraction_options=pycolmap.FeatureExtractionOptions(
type=pycolmap.FeatureExtractorType.ALIKED_N16ROT,
),
)
if __name__ == "__main__":
main()
```
however running it from the cli will succeed
```
./bin/colmap feature_extractor --database_path database.db --image_path ./imgs --FeatureExtraction.type ALIKED_N16ROT
```
## AI Disclaimer
FWIW Codex found this bug and suggested the fix.
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Johannes Schönberger <jsch@demuc.de>
Summary of ChangesHello, 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 prepares for the COLMAP 4.0.2 release by updating version numbers across the project and incorporating several critical bug fixes. The changes primarily focus on improving the robustness of ALIKED feature extraction, both in the core library and its Python bindings, and ensuring correct state management for mesh simplification options. Highlights
Using Gemini Code AssistThe 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
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 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the project to version 4.0.2, incorporating several bug fixes. Key changes include the implementation of ALIKED keypoint score filtering, ensuring correct image reading for ALIKED feature extraction in pycolmap, and addressing a missing reset option for mesh simplification. The test suite for ALIKED feature extraction has also been enhanced to provide more robust verification of the min_score parameter. All modifications align with the stated objectives of the release and appear to be correctly implemented.
No description provided.