Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Image deduplicator using CNN, Cosine Similarity, Image Hashing, Structural Similarity Index Measurement, and Euclidean Distance
Image deduplicator using CNN, Cosine Similarity, Image Hashing, Structural Similarity Index Measurement, and Euclidean Distance
You can install Antidupe using pip:
pip install antidupe
from antidupe import Antidupe
from PIL import Image
# Initialize Antidupe
antidupe = Antidupe()
# Load images (as numpy arrays or PIL.Image objects)
image1 = Image.open("image1.jpg")
image2 = Image.open("image2.jpg")
# Check for duplicates
is_duplicate = antidupe.predict([image1, image2])
if is_duplicate:
print("Duplicate images detected!")
else:
print("Images are not duplicates.")
You can customize the similarity thresholds for each technique during runtime or initialization:
# Initialize Antidupe with custom thresholds
custom_thresholds = {
'ih': 0.2, # Image Hash
'ssim': 0.2, # SSIM
'cs': 0.2, # Cosine Similarity
'cnn': 0.2, # CNN
'dedup': 0.1 # Mobilenet
}
antidupe = Antidupe(limits=custom_thresholds)
# Check for duplicates
is_duplicate = antidupe.predict([image1, image2])
You can enable debug mode to print debugging messages:
# Initialize Antidupe with debug mode enabled
antidupe = Antidupe(debug=True)
# Check for duplicates
is_duplicate = antidupe.predict([image1, image2])
You can change the similarity thresholds during runtime:
# Set new limits during runtime
new_thresholds = {
'ih': 0.1,
'ssim': 0.1,
'cs': 0.1,
'cnn': 0.1,
'dedup': 0.15
}
antidupe.set_limits(limits=new_thresholds)
# Check for duplicates
is_duplicate = antidupe.predict([image1, image2])
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
FAQs
Image deduplicator using CNN, Cosine Similarity, Image Hashing, Structural Similarity Index Measurement, and Euclidean Distance
We found that antidupe demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.