Local task using ljepa

#4
by Fadiargha - opened

How can we use lejepa for any kind of local downstream task? Like defect detection.

You can use LeJEPA as a frozen feature extractor by loading pretrained weights and then doing linear probing for local tasks like defect detection. Extract patch-level embeddings and train a lightweight head (e.g., linear / 1×1 conv) on top.

Minimal code

jepa = models.DINOv3()
jepa.load_state_dict(torch.hub.load_state_dict_from_url(ckpt_url), strict=False)
jepa.eval(); [p.requires_grad_(False) for p in jepa.parameters()]

with torch.no_grad():
feats = jepa(jepa.normalize(x)) # use feats for linear probing

Sign up or log in to comment