Summary of Changes
Hello @ahojnnes, 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 refactors the Python bindings for feature extraction within pycolmap. It introduces a new, unified FeatureExtractor class that serves as a central point for all feature extraction operations, deprecating older, specific extractor classes like Sift and Aliked. This change aims to provide a more consistent and extensible API for users, making it easier to switch between different feature extraction algorithms and integrate new ones in the future. The update also improves flexibility by allowing various image input formats, including NumPy arrays, directly into the extraction process.
Highlights
- Unified Feature Extractor Interface: Introduced a new
FeatureExtractorPython binding, providing a unified and extensible interface for various feature extraction methods (e.g., SIFT, ALIKED). - Deprecation of Specific Extractors: Deprecated the direct use of
pycolmap.Siftandpycolmap.Alikedclasses, encouraging users to leverage the newFeatureExtractor.create()method for consistency and future compatibility. - Flexible Image Input: Added
extractmethods to theFeatureExtractorbinding, supporting feature extraction fromBitmapobjects and various NumPy array types (uint8 and float32). - Feature Extraction Options Enhancement: Enhanced
FeatureExtractionOptionsto allow specifying theFeatureExtractorTypedirectly during initialization, streamlining configuration. - Code Refactoring: Refactored the
BitmapFromArrayutility function into a dedicated header file (pycolmap/sensor/bitmap.h) for improved modularity and organization.
- src/pycolmap/feature/extraction.cc
- Included
colmap/feature/extractor.handpycolmap/sensor/bitmap.hfor new functionalities. - Removed the include for
colmap/feature/utils.h. - Defined
PyFeatureExtractoras a trampoline class to enable Python inheritance forFeatureExtractor. - Added a deprecation warning to the
Siftconstructor, guiding users to the newFeatureExtractor.create()method. - Removed the
Alikedclass and its associated Python bindings, consolidating its functionality under the newFeatureExtractor. - Modified
FeatureExtractionOptionsto acceptFeatureExtractorTypein its constructor and exposed thetypeproperty. - Bound the
FeatureExtractorclass, including a staticcreatemethod andextractoverloads forBitmap,uint8_tNumPy arrays, andfloat32NumPy arrays.
- Included
- src/pycolmap/sensor/bitmap.cc
- Updated the include path for
bitmap.htopycolmap/sensor/bitmap.h. - Removed an unused
pitchvariable within theBitmapFromArrayfunction.
- Updated the include path for
- src/pycolmap/sensor/bitmap.h
- Created a new header file to declare the
BitmapFromArrayutility function, improving code organization.
- Created a new header file to declare the
- No specific activity (comments, reviews, progress updates) has been recorded for this pull request yet.
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. โฉ