Views
No views yet
cls_patch).torch.hub — no manual download needed.1import torch
2from PIL import Image
3from id_sim import id_sim
4
5model, preprocess = id_sim(pretrained=True, model_type="dinov2_vitb14", device="cuda")
6
7img_a = preprocess(Image.open("a.jpg")).cuda()
8img_b = preprocess(Image.open("b.jpg")).cuda()
9
10with torch.inference_mode():
11 distance = model(img_a, img_b) # lower = more similarpip install git+https://github.com/JuliaChae/id_sim.git| Base model | DINOv2 ViT-B/14 (dinov2_vitb14) |
| Fine-tuning | LoRA (r=16, α=32, dropout=0.05) + MLP heads (hidden=512) |
| Feature type | cls_patch — joint CLS + Sinkhorn patch loss |
| License | MIT |
| Developed by | Julia Chae, Nicholas Kolkin, Jui-Hsien Wang, Richard Zhang, Sara Beery, Cusuh Ham |
1@InProceedings{Chae_2026_CVPR,
2 author = {Chae, Julia and Kolkin, Nicholas and Wang, Jui-Hsien and Zhang, Richard and Beery, Sara and Ham, Cusuh},
3 title = {ID-Sim: An Identity-Focused Similarity Metric},
4 booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
5 month = {June},
6 year = {2026},
7 pages = {11250-11262}
8}