imagededup
Route image deduplication tasks for the imagededup package: hash-based duplicate detection, CNN-based duplicate detection with custom models, and evaluation or plotting of duplicate maps.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- imagededup
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Route image deduplication tasks for the imagededup package: hash-based duplicate detection, CNN-based duplicate detection with custom models, and evaluation or plotting of duplicate maps.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/installation.md2.3 KB
- 参考文档references/repo-provenance.md797 B
- 参考文档references/repo-routing-metadata.json323 B
- 参考文档references/troubleshooting.md4.7 KB
03 SKILL.md 正文
imagededup
Use this skill for the imagededup package when the task is about finding exact or near-duplicate images, generating encodings, comparing duplicate maps, or plotting duplicate relationships.
Start here
- Use
sub-skills/hashing/SKILL.mdfor perceptual, average, difference, or wavelet hashing; duplicate search by Hamming distance; or remove-list generation. - Use
sub-skills/cnn/SKILL.mdfor CNN-based encodings, pretrained or custom models, cosine-similarity duplicate search, or GPU/CPU behavior. - Use
sub-skills/evaluation/SKILL.mdfor evaluating retrieved duplicate maps and plotting duplicate groups.
What this skill covers
- Encoding one image or a directory of images.
- Finding duplicates from a directory or from a precomputed encoding map.
- Removing duplicate filenames with a heuristic list, not deleting files.
- Evaluating retrieved duplicate maps against a symmetric ground-truth map.
- Plotting one image and its duplicates.
- Custom CNN model wrappers and the bundled pretrained CNN backbones.
What this skill does not cover
- Package release automation.
- Docs building or site generation.
- Benchmark reproduction as a maintainer task.
- External dataset downloads such as the CIFAR10 Colab example.
Quick install for inspection or verification
Create an isolated Python 3.11 environment, then install the package from PyPI plus the runtime imports that this version uses but does not fully declare in metadata.
python -m pip install "imagededup==0.3.3.post2" numpy scipy
If you plan to run package tests in a separate source checkout, also install pytest and pytest-mock there.
Minimal import check
from imagededup.methods import PHash, AHash, DHash, WHash, CNN
from imagededup.evaluation import evaluate
from imagededup.utils import plot_duplicates, CustomModel
Routing guidance
Read the matching sub-skill when the user asks for any of the following:
- exact or near duplicate lookup with
PHash,AHash,DHash, orWHash - hash generation from files, directories, or image arrays
find_duplicates/find_duplicates_to_removewith Hamming thresholdssearch_method,bktree,brute_force, orbrute_force_cython- CNN encodings, cosine similarity, or
CustomModel - pretrained MobileNetV3, ViT, or EfficientNet backbones
evaluate, MAP, NDCG, Jaccard, precision, recall, or F1plot_duplicates
Common first checks
- Confirm the image paths or encoding map are valid.
- Confirm the threshold type matches the workflow.
- Decide whether the task is hash-based or CNN-based.
- Use evaluation only after you already have a ground-truth map and a retrieved map.
- Use plotting only after the duplicate map is non-empty.
Helpful bundled references
- Read
references/installation.mdfor repo-specific install notes, including missing metadata dependencies and CNN weight downloads. - Read
references/troubleshooting.mdfor cross-cutting import, image-format, backend, and Windows multiprocessing issues. - Read
references/repo-provenance.mdwhen you need the source revision behind this skill. - Read
references/repo-routing-metadata.jsonwhen another agent needs to route tasks into this repo skill.
Script helpers
- Run
sub-skills/hashing/scripts/hash_smoke.pyto generate a synthetic hash workflow smoke check. - Run
sub-skills/cnn/scripts/cnn_smoke.pyto exercise CNN encoding and duplicate search with a safe synthetic fixture. - Run
sub-skills/evaluation/scripts/evaluate_plot_smoke.pyto exercise metrics and duplicate plotting with generated data.
Fast routing summary
- Hashes and Hamming distance -> hashing sub-skill.
- CNN encodings and custom models -> CNN sub-skill.
- Metrics and plots -> evaluation sub-skill.
When in doubt, prefer the most specific sub-skill that owns the user-visible workflow, then use the shared references only for install or troubleshooting context.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).