ahojnnes ยท GitHub

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 FeatureExtractor Python 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.Sift and pycolmap.Aliked classes, encouraging users to leverage the new FeatureExtractor.create() method for consistency and future compatibility.
  • Flexible Image Input: Added extract methods to the FeatureExtractor binding, supporting feature extraction from Bitmap objects and various NumPy array types (uint8 and float32).
  • Feature Extraction Options Enhancement: Enhanced FeatureExtractionOptions to allow specifying the FeatureExtractorType directly during initialization, streamlining configuration.
  • Code Refactoring: Refactored the BitmapFromArray utility function into a dedicated header file (pycolmap/sensor/bitmap.h) for improved modularity and organization.
Changelog
  • src/pycolmap/feature/extraction.cc
    • Included colmap/feature/extractor.h and pycolmap/sensor/bitmap.h for new functionalities.
    • Removed the include for colmap/feature/utils.h.
    • Defined PyFeatureExtractor as a trampoline class to enable Python inheritance for FeatureExtractor.
    • Added a deprecation warning to the Sift constructor, guiding users to the new FeatureExtractor.create() method.
    • Removed the Aliked class and its associated Python bindings, consolidating its functionality under the new FeatureExtractor.
    • Modified FeatureExtractionOptions to accept FeatureExtractorType in its constructor and exposed the type property.
    • Bound the FeatureExtractor class, including a static create method and extract overloads for Bitmap, uint8_t NumPy arrays, and float32 NumPy arrays.
  • src/pycolmap/sensor/bitmap.cc
    • Updated the include path for bitmap.h to pycolmap/sensor/bitmap.h.
    • Removed an unused pitch variable within the BitmapFromArray function.
  • src/pycolmap/sensor/bitmap.h
    • Created a new header file to declare the BitmapFromArray utility function, improving code organization.
Activity
  • No specific activity (comments, reviews, progress updates) has been recorded for this pull request yet.
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. โ†ฉ

Read the original on github.com โ†—