-
Notifications
You must be signed in to change notification settings - Fork 32.7k
🚨🚨🚨 [SuperPoint] Fix keypoint coordinate output and add post processing #33200
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
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
17d50e8
feat: Added int conversion and unwrapping
285c465
test: added tests for post_process_keypoint_detection of SuperPointIm…
sbucaille 2efe61b
docs: changed docs to include post_process_keypoint_detection method …
sbucaille a77b870
test: changed test to not depend on SuperPointModel forward
sbucaille 2ab79cd
test: added missing require_torch decorator
sbucaille 419ae5d
docs: changed pyplot parameters for the keypoints to be more visible …
sbucaille 39b32a2
tests: changed import torch location to make test_flax and test_tf
sbucaille 144e09a
Revert "tests: changed import torch location to make test_flax and te…
sbucaille 21dbdfc
tests: fixed import
sbucaille 389b154
chore: applied suggestions from code review
sbucaille b7d672e
tests: fixed import
sbucaille f5d7311
tests: fixed import (bis)
sbucaille d89d385
tests: fixed import (ter)
sbucaille f9e1141
feat: added choice of type for target_size and changed tests accordingly
sbucaille 32a2e96
docs: updated code snippet to reflect the addition of target size typ…
sbucaille 560194e
tests: fixed imports (...)
2d28aba
tests: fixed imports (...)
bd23baa
style: formatting file
5bb0baf
docs: fixed typo from image[0] to image.size[0]
sbucaille ed28314
docs: added output image and fixed some tests
sbucaille 192448d
Update docs/source/en/model_doc/superpoint.md
sbucaille e89af7f
fix: included SuperPointKeypointDescriptionOutput in TYPE_CHECKING if…
sbucaille 4e77a4f
docs: changed SuperPoint's docs to print output instead of just acces…
sbucaille e9b642a
style: applied make style
sbucaille e085861
docs: added missing output type and precision in docstring of post_pr…
sbucaille 9127545
perf: deleted loop to perform keypoint conversion in one statement
sbucaille 1ffa465
fix: moved keypoint conversion at the end of model forward
sbucaille b0d25a3
docs: changed SuperPointInterestPointDecoder to SuperPointKeypointDec…
sbucaille 1fb5705
fix: changed type hint
sbucaille 13cb7e5
refactor: removed unnecessary brackets
sbucaille eb6a5aa
revert: SuperPointKeypointDecoder to SuperPointInterestPointDecoder
sbucaille 4c34d75
Update docs/source/en/model_doc/superpoint.md
sbucaille File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -260,7 +260,7 @@ def test_inference(self): | |
| inputs = preprocessor(images=images, return_tensors="pt").to(torch_device) | ||
| with torch.no_grad(): | ||
| outputs = model(**inputs) | ||
| expected_number_keypoints_image0 = 567 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wondering why the number of keypoints changed :) |
||
| expected_number_keypoints_image0 = 568 | ||
| expected_number_keypoints_image1 = 830 | ||
| expected_max_number_keypoints = max(expected_number_keypoints_image0, expected_number_keypoints_image1) | ||
| expected_keypoints_shape = torch.Size((len(images), expected_max_number_keypoints, 2)) | ||
|
|
@@ -275,11 +275,13 @@ def test_inference(self): | |
| self.assertEqual(outputs.keypoints.shape, expected_keypoints_shape) | ||
| self.assertEqual(outputs.scores.shape, expected_scores_shape) | ||
| self.assertEqual(outputs.descriptors.shape, expected_descriptors_shape) | ||
| expected_keypoints_image0_values = torch.tensor([[480.0, 9.0], [494.0, 9.0], [489.0, 16.0]]).to(torch_device) | ||
| expected_keypoints_image0_values = torch.tensor([[0.75, 0.0188], [0.7719, 0.0188], [0.7641, 0.0333]]).to( | ||
| torch_device | ||
| ) | ||
| expected_scores_image0_values = torch.tensor( | ||
| [0.0064, 0.0137, 0.0589, 0.0723, 0.5166, 0.0174, 0.1515, 0.2054, 0.0334] | ||
| [0.0064, 0.0139, 0.0591, 0.0727, 0.5170, 0.0175, 0.1526, 0.2057, 0.0335] | ||
| ).to(torch_device) | ||
| expected_descriptors_image0_value = torch.tensor(-0.1096).to(torch_device) | ||
| expected_descriptors_image0_value = torch.tensor(-0.1095).to(torch_device) | ||
qubvel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| predicted_keypoints_image0_values = outputs.keypoints[0, :3] | ||
| predicted_scores_image0_values = outputs.scores[0, :9] | ||
| predicted_descriptors_image0_value = outputs.descriptors[0, 0, 0] | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.