Skip to content

Conversation

taras-sereda
Copy link

This PR optimizes computation of hamming distance by XORing two integers and counting bits. On folder with 4000 images allows to compute all pair-wise distances 30x faster then current implementation.

Attention: bit_count() was added in python 3.10
for earlier python version an equivalent helper function will serve the same purpose:

def big_count(n):
    count = 0
    while n:
        count += n & 1
        n >>= 1
    return count

tanujjain and others added 5 commits April 28, 2023 18:55
Signed-off-by: Peter Jentsch <[email protected]>
removed announcement to archive project.

Signed-off-by: Peter Jentsch <[email protected]>
@tanujjain tanujjain changed the base branch from master to dev May 14, 2025 12:41
@tanujjain
Copy link
Collaborator

Thanks for the PR.

Currently, the package supports Python 3.9 too. It would be a bit messy to detect python version and use the corresponding implementation.

Python 3.9 reaches end of life in October 2025, after which imagededup will also revoke support for it. I would be happy to merge the PR then.

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.

3 participants