Skip to content

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ä <[email protected]>
@marcelklehr
Copy link
Member

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

@MB-Finski MB-Finski changed the title Opitimize distance calculation algorithm Optimize distance calculation algorithm Feb 22, 2025
@marcelklehr marcelklehr merged commit 5cf50b6 into nextcloud:main Mar 11, 2025
39 of 40 checks passed
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