Skip to content

Add EUPE support#696

Merged
guarin merged 7 commits intomainfrom
guarin-trn-1903-add-eupe-support
Apr 10, 2026
Merged

Add EUPE support#696
guarin merged 7 commits intomainfrom
guarin-trn-1903-add-eupe-support

Conversation

@guarin
Copy link
Copy Markdown
Contributor

@guarin guarin commented Apr 10, 2026

What has changed and why?

Adds support for the new EUPE models from Meta.

Usage is very simple. Instead of model="dinov3/vits16" for pretraining or model="dinov3/vits16-ltdetr" for fine-tuning you can now use model="dinov3/vits16-eupe" for pretraining with EUPE or model="dinov3/vits16-eupe-ltdetr" for fine-tuning.

I'll add docs/changelog in a follow up once #691 is merged.

Distillation

import lightly_train

if __name__ == "__main__":
    lightly_train.pretrain(
        out="out/my_experiment",
        data="my_data_dir",
        model="dinov3/vitt16",
        method="distillation",
        method_args={
            "teacher": "dinov3/vitb16-eupe", # Distill from EUPE ViT-B/16
        },
    )

Fine-tuning

import lightly_train

if __name__ == "__main__":
    lightly_train.train_semantic_segmentation(
        out="out/my_experiment",
        model="dinov3/vits16-eupe-eomt",
        data={...},
    )

How has it been tested?

  • Manually

Did you update CHANGELOG.md?

  • Yes
  • Not needed (internal change)

Did you update the documentation?

  • Yes
  • Not needed (internal change without effects for user)

Copilot AI review requested due to automatic review settings April 10, 2026 14:45
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e049c9c590

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lightly_train/_models/dinov3/dinov3_package.py Outdated
Comment thread src/lightly_train/_models/dinov3/dinov3_package.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for Meta’s EUPE checkpoints in the DINOv3 model package and ensures EUPE backbones can be used with the DINOv3 LTDETR object detection task.

Changes:

  • Register new *-eupe DINOv3 backbone names and point them at EUPE checkpoint URLs.
  • Make LTDETR config selection tolerant to -eupe suffixes on backbone names.
  • Strip EUPE-specific projector weights from loaded checkpoints to keep strict state-dict loading working.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/lightly_train/_task_models/dinov3_ltdetr_object_detection/task_model.py Strips -eupe from backbone names when selecting the LTDETR config.
src/lightly_train/_models/dinov3/dinov3_src/hub/backbones.py Filters EUPE-only state-dict keys before strict loading for ViT and ConvNeXt backbones.
src/lightly_train/_models/dinov3/dinov3_package.py Adds EUPE model-name entries mapping to existing backbone builders + EUPE checkpoint URLs.

Comment thread src/lightly_train/_models/dinov3/dinov3_src/hub/backbones.py Outdated
Comment thread src/lightly_train/_models/dinov3/dinov3_src/hub/backbones.py
Comment thread src/lightly_train/_models/dinov3/dinov3_src/hub/backbones.py Outdated
Comment thread src/lightly_train/_models/dinov3/dinov3_package.py Outdated
@guarin
Copy link
Copy Markdown
Contributor Author

guarin commented Apr 10, 2026

/review

Copy link
Copy Markdown
Contributor

@liopeer liopeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I will create a follow-up to add support for other downstream tasks and to document it.

@guarin
Copy link
Copy Markdown
Contributor Author

guarin commented Apr 10, 2026

LGTM! I will create a follow-up to add support for other downstream tasks and to document it.

All downstream tasks should already be supported. LTDETR just needed some extra logic

@guarin guarin enabled auto-merge (squash) April 10, 2026 15:17
@guarin guarin merged commit 7bc1aa3 into main Apr 10, 2026
16 checks passed
@guarin guarin deleted the guarin-trn-1903-add-eupe-support branch April 10, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants