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

Opitimize distance calculation algorithm #1245

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MB-Finski
Copy link
Contributor

I know I'm a bit late to the party what with the ex-apps and all but here's an improved distance calculation algorithm for face recognition clustering:

Since, the calculation of vector-to-vector distances is done almost to the tune of face detections squared (likely millions of times for each clustering run), even small improvements here should translate to considerable improvements in the overall performance.

Benchmark results for 1000000 distance calculations:
------------------------------------------------------------
Original Method (foreach & ** 2):       7.921905 seconds
Optimized Method (for loop & * 2):      3.993280 seconds
------------------------------------------------------------

Signed-off-by: Sami Finnilä <64466176+MB-Finski@users.noreply.github.com>
@marcelklehr
Copy link
Member

Woop woop, awesome :) Thank you!
Looking forward to more PRs from you 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants