Skip to content
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 cucim.skimage.feature.match_descriptors #338

Merged
merged 2 commits into from
Oct 5, 2022

Conversation

grlee77
Copy link
Contributor

@grlee77 grlee77 commented Jul 26, 2022

closes #193

This PR adds cucim.skimage.feature.match_descriptors. It is a very straightforward adaptation of the scikit-image code, only substituting numpy->cupy. The only differences of note are:

  • when new enough CuPy and pylibraft are not available it warns and falls back to cdist on the CPU
  • test cases involving BRIEF temporarily involve round trip to the host until we implement BRIEF here (looks not too hard)

This PR also removes the deprecated masked_register_translation and register_translation (these were moved to cucim.skimage.registration.phase_cross_correlation) from the feature` module. Removing those was missed when previously updating the API here to match scikit-image 0.19.

@grlee77 grlee77 added feature request New feature or request non-breaking Introduces a non-breaking change labels Jul 26, 2022
@grlee77 grlee77 added this to the v22.08.00 milestone Jul 26, 2022
@grlee77 grlee77 requested a review from a team as a code owner July 26, 2022 13:38
@grlee77
Copy link
Contributor Author

grlee77 commented Jul 26, 2022

The acceleration provided here will depend on the number and size of the descriptors. Running scikit-image's SIFT on the small astronaut image results in 1234 descriptors each of size 128. For that size of input, the relative acceleration on the GPU is quite good.

When cross_check=False, max_distance=np.inf, max_ratio = 1.0
Acceleration = 333.44040448425943

When cross_check=True, max_distance=np.inf, max_ratio = 1.0
Acceleration = 138.47554030822292

When cross_check=False, max_distance=100.0, max_ratio < 1.0
Acceleration = 58.34578386444441

In the latter two cases there are progressively more logical comparisons and indexing operations which end up reducing the overall acceleration factor as compared to the first case without any additional checks.

@jakirkham jakirkham modified the milestones: v22.08.00, v22.10.00 Aug 1, 2022
@jakirkham jakirkham changed the base branch from branch-22.08 to branch-21.10 August 1, 2022 19:24
@jakirkham jakirkham requested review from a team as code owners August 1, 2022 19:24
@jakirkham jakirkham changed the base branch from branch-21.10 to branch-22.10 August 1, 2022 19:24
@jakirkham
Copy link
Member

Moved to 22.10

There's not a project board for this yet. So moved to feature planning for now. Can update that later

@ajschmidt8 ajschmidt8 removed the request for review from a team August 1, 2022 20:20
@ajschmidt8
Copy link
Member

Removing ops-codeowners from the required reviews since it doesn't seem there are any file changes that we're responsible for. Feel free to add us back if necessary.

@jakirkham
Copy link
Member

Yeah I accidentally got 21.10 the first time 🤦‍♂️ Sorry for the noise 😞

Should be fixed now 🍀

@grlee77
Copy link
Contributor Author

grlee77 commented Aug 1, 2022

This PR now has that same issue we saw previously where the distance_transform_edt import fails even though the files are in this branch.

src/cucim/core/operations/morphology/tests/test_distance_transform.py:8: in <module>
    from cucim.core.operations.morphology import distance_transform_edt
E   ModuleNotFoundError: No module named 'cucim.core.operations.morphology'

I need to look into how we are doing the install when testing on CI. Perhaps the files are there during build but are getting omitted somehow during the package install stage? That doesn't really make sense to me, though, since it did pass previously in the branch-22.08 PR

@grlee77
Copy link
Contributor Author

grlee77 commented Aug 3, 2022

rerun tests

Copy link
Contributor

@gigony gigony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you Greg!

@gigony
Copy link
Contributor

gigony commented Oct 5, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 8ad50fa into rapidsai:branch-22.10 Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request non-breaking Introduces a non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] gpu enabled match_descriptors
4 participants