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

Replace FLANN w. nanoflann/Annoy and merge it with Features[2D] #24998

Open
vpisarev opened this issue Feb 12, 2024 · 2 comments
Open

Replace FLANN w. nanoflann/Annoy and merge it with Features[2D] #24998

vpisarev opened this issue Feb 12, 2024 · 2 comments
Labels
cleanup Code cleanup (e.g, drop legacy C-API, legacy unmaintained code) feature
Milestone

Comments

@vpisarev
Copy link
Contributor

vpisarev commented Feb 12, 2024

Describe the feature and motivation

Approximate nearest-neighbor search is very important research and development area of today's AI technologies. Besides computer vision (e.g. in face or scene recognition applications), they are actively used for recommendation systems, e.g. https://www.benfrederickson.com/approximate-nearest-neighbours-for-recommender-systems/.

There are high-profile specialized packages for this task, mentioned in the above paper, such as Annoy, NMSLib, Faiss.

By comparison, FLANN, a fork of it integrated into OpenCV, looks very old and it's not maintained. It is suggested that in OpenCV 5, since we have an opportunity to clean the library, we will remove a separate module FLANN.

The following two options are suggested:

  1. use single-header BSD-licensed nanoflann: https://github.com/jlblancoc/nanoflann/tree/master/include. It implements essential subset of FLANN functionality, so it should be a smooth replacement.
  2. use Apache-2 licensed Spotify's Annoy library: https://github.com/spotify/annoy. Annoy contains just a few files and so it can also be put directly to OpenCV, without creating explicit opencv/3rdparty entry.

The upgraded 'mini FLANN' (nanoflann or Annoy) can be put to features2d where it logically belongs.

Probably, features2d should be renamed to features to reflect that it can be used not just for features extracted from 2D images. The current modern way to compute features is to run a deep learning model.

Additional context

No response

@vpisarev vpisarev added feature cleanup Code cleanup (e.g, drop legacy C-API, legacy unmaintained code) labels Feb 12, 2024
@vpisarev vpisarev added this to the 5.0 milestone Feb 12, 2024
@crackwitz
Copy link
Contributor

crackwitz commented Feb 12, 2024

Suggestion: adjust title to something like

Replace FLANN implementation, move into features2d

At first glance, the current title looks like removal of the feature, not dissolution of a module and relocation of its APIs to another one.

Replacing the old code with something maintained, strikes me as technically sound. At this time, I have no further opinion on any of this.

@vpisarev vpisarev changed the title Remove FLANN Replace FLANN w. nanoflann/Annoy and merge it with Features[2D] Feb 12, 2024
@vpisarev
Copy link
Contributor Author

@crackwitz, thanks, I changed the title

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code cleanup (e.g, drop legacy C-API, legacy unmaintained code) feature
Projects
Status: Todo
Development

No branches or pull requests

2 participants