-
Notifications
You must be signed in to change notification settings - Fork 31.1k
Fix post processing methods in keypoints matching models #42018
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
base: main
Are you sure you want to change the base?
Fix post processing methods in keypoints matching models #42018
Conversation
|
[For maintainers] Suggested jobs to run (before merge) run-slow: efficientloftr, lightglue, superglue |
|
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.
Sounds good to me! Thanks for fixing/improving 🤗
| if outputs.matches.shape[0] != len(target_sizes): | ||
| raise ValueError("Make sure that you pass in as many target sizes as the batch dimension of the mask") | ||
| if not all(len(target_size) == 2 for target_size in target_sizes): | ||
| raise ValueError("Each element of target_sizes must contain the size (h, w) of each image of the batch") | ||
|
|
||
| if isinstance(target_sizes, list): | ||
| image_pair_sizes = torch.tensor(target_sizes, device=outputs.matches.device) | ||
| else: | ||
| if target_sizes.shape[1] != 2 or target_sizes.shape[2] != 2: | ||
| raise ValueError( | ||
| "Each element of target_sizes must contain the size (h, w) of each image of the batch" | ||
| ) | ||
| image_pair_sizes = target_sizes |
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.
Sounds good, but do we need all these exceptions handlings?
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.
I copied them from the slow processor. But yes we don't really need them indeed
What does this PR do?
Fixes #42005.
Also fixes post processing functions in superglue and lightglue fast image processors, which were wrongly taken from efficientloftr