This repository contains a full pipeline to detect added, removed, and changed objects between two images using:
- Open-vocabulary detection (OWL-ViT; optional GroundingDINO)
- Siamese ViT change localization (heatmaps)
- CLIP-assisted matching + IoU
- TTA + Weighted Boxes Fusion (WBF)
- Threshold tuning on a validation split
notebooks/— Jupyter notebooks (enhanced and baseline)src/— Python modules (future extraction of notebook logic)models/— Saved weights/checkpointsdata/— Data staging area (raw/processed). Do not commit large data.outputs/— Generated artifacts (predictions, figures)
Key files in root:
spot_the_difference_workflow.ipynb— Baseline notebookspot_the_difference_workflow_enhanced.ipynb— Enhanced notebookspot_the_difference_procedure.md— Pipeline descriptionrequirements.txt— Python dependencies.gitignore— Ignore large/cache artifacts
- Create a virtual environment (recommended) and install requirements:
python -m pip install -r requirements.txt- Open the enhanced notebook and run cells top-to-bottom:
spot_the_difference_workflow_enhanced.ipynb
- Outputs:
submission.csv,eval_metrics.txtat repo root- Model weights in
models/(if configured)
Expected layout for images:
data/
train.csv
test.csv
data/
<img_id>_1.png
<img_id>_2.png
Adjust paths in the notebooks if your layout differs.
- GPU is recommended; first run will download models.
- GroundingDINO is optional; code falls back to OWL-ViT.
- Consider widening the threshold tuning ranges for better performance.