fix: deprecate plot_keypoint_matching and make visualize_keypoint_matching for all Keypoint Matching models#39830
Conversation
…ching for all Keypoint Matching models
qubvel
left a comment
There was a problem hiding this comment.
@sbucaille Thanks for making it standardized! Just a few comments
|
|
||
| return results | ||
|
|
||
| def visualize_keypoint_matching( |
| ) -> list[dict[str, torch.Tensor]]: | ||
| return super().post_process_keypoint_matching(outputs, target_sizes, threshold) | ||
|
|
||
| def visualize_keypoint_matching( |
| plt.scatter(keypoint1_x + width0, keypoint1_y, c="black", s=2) | ||
| plt.show() | ||
|
|
||
| def _get_color(self, score): |
|
|
||
| return results | ||
|
|
||
| def visualize_keypoint_matching( |
| def plot_keypoint_matching(self, images: ImageInput, keypoint_matching_output): | ||
| """ | ||
| Plots the image pairs side by side with the detected keypoints as well as the matching between them. Requires | ||
| matplotlib to be installed. | ||
|
|
||
| .. deprecated:: | ||
| `plot_keypoint_matching` is deprecated and will be removed in a future version. Use `visualize_keypoint_matching` instead. | ||
|
|
||
| Args: | ||
| images (`ImageInput`): | ||
| Image pairs to plot. Same as `SuperGlueImageProcessor.preprocess`. Expects either a list of 2 images or |
There was a problem hiding this comment.
no need to add this method, it's going to be removed
There was a problem hiding this comment.
I went autopilot there, didn't mean to 😅
|
[For maintainers] Suggested jobs to run (before merge) run-slow: efficientloftr, lightglue, superglue |
qubvel
left a comment
There was a problem hiding this comment.
Thanks, just a nit and ready to be merged!
| - preprocess | ||
| - post_process_keypoint_matching | ||
| - plot_keypoint_matching | ||
| - visualize_keypoint_matching |
There was a problem hiding this comment.
let's add the same for superglue
There was a problem hiding this comment.
Indeed, forgot about this one, fixed !
|
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. |
…e_keypoint_matching` as a standard (huggingface#39830) * fix: deprecate plot_keypoint_matching and make visualize_keypoint_matching for all Keypoint Matching models * refactor: added copied from * fix: make style * fix: repo consistency * fix: make style * docs: added missing method in SuperGlue docs
…e_keypoint_matching` as a standard (huggingface#39830) * fix: deprecate plot_keypoint_matching and make visualize_keypoint_matching for all Keypoint Matching models * refactor: added copied from * fix: make style * fix: repo consistency * fix: make style * docs: added missing method in SuperGlue docs
…e_keypoint_matching` as a standard (huggingface#39830) * fix: deprecate plot_keypoint_matching and make visualize_keypoint_matching for all Keypoint Matching models * refactor: added copied from * fix: make style * fix: repo consistency * fix: make style * docs: added missing method in SuperGlue docs
…e_keypoint_matching` as a standard (huggingface#39830) * fix: deprecate plot_keypoint_matching and make visualize_keypoint_matching for all Keypoint Matching models * refactor: added copied from * fix: make style * fix: repo consistency * fix: make style * docs: added missing method in SuperGlue docs
…e_keypoint_matching` as a standard (huggingface#39830) * fix: deprecate plot_keypoint_matching and make visualize_keypoint_matching for all Keypoint Matching models * refactor: added copied from * fix: make style * fix: repo consistency * fix: make style * docs: added missing method in SuperGlue docs
…e_keypoint_matching` as a standard (huggingface#39830) * fix: deprecate plot_keypoint_matching and make visualize_keypoint_matching for all Keypoint Matching models * refactor: added copied from * fix: make style * fix: repo consistency * fix: make style * docs: added missing method in SuperGlue docs
…e_keypoint_matching` as a standard (huggingface#39830) * fix: deprecate plot_keypoint_matching and make visualize_keypoint_matching for all Keypoint Matching models * refactor: added copied from * fix: make style * fix: repo consistency * fix: make style * docs: added missing method in SuperGlue docs
What does this PR do?
Adds
visualize_keypoint_matchingto LightGlue and SuperGlue image processorDeprecate
plot_keypoint_matchingfrom LightGlue image processorWho can review?
@qubvel @stevhliu