Skip to content

Unify DINOv3 fine-tuning backbone loading#642

Merged
guarin merged 7 commits intomainfrom
unify-dinov3-ft-backbone-loading
Mar 23, 2026
Merged

Unify DINOv3 fine-tuning backbone loading#642
guarin merged 7 commits intomainfrom
unify-dinov3-ft-backbone-loading

Conversation

@guarin
Copy link
Copy Markdown
Contributor

@guarin guarin commented Mar 13, 2026

What has changed and why?

  • Unify DINOv3 fine-tuning backbone loading
  • Fix bug when loading dinov3/vitt16-ltdetr which loaded dinov3/vitt16-notpretrained-ltdetr instead

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 March 13, 2026 09:02
@guarin
Copy link
Copy Markdown
Contributor Author

guarin commented Mar 13, 2026

/review

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

This PR unifies DINOv3 fine-tuning backbone loading across LTDETR object detection and EoMT segmentation task models, and fixes an issue where certain LTDETR backbones/checkpoints would not load the intended weights.

Changes:

  • Route backbone weight handling through DINOV3_PACKAGE.get_model(...) consistently (instead of per-task special casing).
  • Adjust DINOv3 package logic to set pretrained=True when explicit weights are provided.
  • Add logging around checkpoint loading and document the fix in CHANGELOG.md.

Reviewed changes

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

Show a summary per file
File Description
src/lightly_train/_task_models/dinov3_ltdetr_object_detection/task_model.py Uses unified DINOV3_PACKAGE.get_model backbone loading and removes local path existence branching.
src/lightly_train/_task_models/dinov3_eomt_semantic_segmentation/task_model.py Switches backbone loading to the package API and removes custom weight-loading helper.
src/lightly_train/_task_models/dinov3_eomt_panoptic_segmentation/task_model.py Same unification as semantic segmentation; removes custom weight-loading helper.
src/lightly_train/_task_models/dinov3_eomt_instance_segmentation/task_model.py Same unification as semantic segmentation; removes custom weight-loading helper.
src/lightly_train/_models/dinov3/dinov3_src/hub/backbones.py Logs the resolved checkpoint URL used for weight loading.
src/lightly_train/_models/dinov3/dinov3_package.py Ensures pretrained is enabled when explicit weights are provided and load_weights=True.
CHANGELOG.md Adds a “Fixed” entry describing the LTDETR backbone-loading bug fix.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/lightly_train/_models/dinov3/dinov3_package.py
Comment thread src/lightly_train/_models/dinov3/dinov3_src/hub/backbones.py Outdated
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: 26362b5698

ℹ️ 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/_task_models/dinov3_eomt_instance_segmentation/task_model.py Outdated
Copy link
Copy Markdown
Contributor

@yutong-xiang-97 yutong-xiang-97 left a comment

Choose a reason for hiding this comment

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

Left one comment

Comment thread src/lightly_train/_models/dinov3/dinov3_package.py
@guarin guarin merged commit 34afe0d into main Mar 23, 2026
16 checks passed
@guarin guarin deleted the unify-dinov3-ft-backbone-loading branch March 23, 2026 08:13
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