-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Add LightGlue fast image processor #41670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LightGlue fast image processor #41670
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
molbap
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool! left minor comments
| Whether to convert the image to grayscale. Can be overridden by `do_grayscale` in the `preprocess` method. | ||
| """ | ||
|
|
||
| do_grayscale: bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convert_to_grayscale maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed it's better but it would be breaking BC :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true true
| This function is supposed to return a 1-channel image, but it returns a 3-channel image with the same value in each | ||
| channel, because of an issue that is discussed in : | ||
| https://github.com/huggingface/transformers/pull/25786#issuecomment-1730176446 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is still a problem, but better to keep it just in case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah not a big issue, it's just funny to see
src/transformers/models/lightglue/image_processing_lightglue_fast.py
Outdated
Show resolved
Hide resolved
|
[For maintainers] Suggested jobs to run (before merge) run-slow: auto, lightglue |
|
Thanks for the review @molbap ! It should be good now :) |
molbap
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, looks good to me! Nice work!
| Whether to convert the image to grayscale. Can be overridden by `do_grayscale` in the `preprocess` method. | ||
| """ | ||
|
|
||
| do_grayscale: bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true true
| This function is supposed to return a 1-channel image, but it returns a 3-channel image with the same value in each | ||
| channel, because of an issue that is discussed in : | ||
| https://github.com/huggingface/transformers/pull/25786#issuecomment-1730176446 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah not a big issue, it's just funny to see
| class LightGlueImageProcessorFast(SuperGlueImageProcessorFast): | ||
| def post_process_keypoint_matching( | ||
| self, | ||
| outputs: LightGlueKeypointMatchingOutput, | ||
| target_sizes: Union[TensorType, list[tuple]], | ||
| threshold: float = 0.0, | ||
| ) -> list[dict[str, torch.Tensor]]: | ||
| return super().post_process_keypoint_matching(outputs, target_sizes, threshold) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's cool
* add fast image processor skel * add working lightglue fast image processor + tests * remove plot_keypoint_matching
* add fast image processor skel * add working lightglue fast image processor + tests * remove plot_keypoint_matching
What does this PR do?
As the title says