Skip to content

Add DINOv2 EoMT Panoptic Segmentation#630

Merged
guarin merged 98 commits intomainfrom
add-dinov2-panoptic-segmentation
Mar 9, 2026
Merged

Add DINOv2 EoMT Panoptic Segmentation#630
guarin merged 98 commits intomainfrom
add-dinov2-panoptic-segmentation

Conversation

@guarin
Copy link
Copy Markdown
Contributor

@guarin guarin commented Mar 4, 2026

What has changed and why?

  • Add DINOv2 EoMT Panoptic Segmentation

Panoptic Segmentation - LightlyTrain documentation_dinov2.pdf

How has it been tested?

  • Added test

Did you update CHANGELOG.md?

  • Yes
  • Not needed (internal change)

Did you update the documentation?

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

guarin added 30 commits February 10, 2026 15:28
- Add base classes: MetricArgs, TaskMetricArgs, TaskMetric
- Add multiclass metrics: Accuracy, F1, Precision, Recall
- Add multilabel metrics: Accuracy, F1, Precision, Recall, AUROC, Average Precision, Hamming Distance
- Add ClassificationTaskMetricArgs and ClassificationTaskMetric
- TaskMetric inherits from nn.Module for automatic device handling
- Support for classwise metrics with ClasswiseWrapper
- Comprehensive documentation on structure and adding new metrics
- Add object detection metrics with MeanAveragePrecision
- Add instance segmentation metrics with MeanAveragePrecision (iou_type="segm")
- Add semantic segmentation metrics with JaccardIndex (mIoU)
- Add panoptic segmentation metrics with PanopticQuality (PQ/SQ/RQ)
- Include classwise metrics for detection, instance segmentation, and semantic segmentation
- Add minimal tests following classification pattern (18 tests total, all passing)
- Handle per-class metric expansion from torchmetrics outputs
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: 16dc8ea2b7

ℹ️ 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 tests/_commands/test_train_task.py
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: 0891fc2f20

ℹ️ 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 tests/_commands/test_train_task.py
@guarin
Copy link
Copy Markdown
Contributor Author

guarin commented Mar 5, 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!

Base automatically changed from metrics-refactor to main March 6, 2026 13:47
Copilot AI review requested due to automatic review settings March 6, 2026 14:01
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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 DINOv2-backed EoMT panoptic segmentation support to LightlyTrain, extending the existing EoMT segmentation task family (previously DINOv3-focused) with DINOv2 inference + fine-tuning, plus docs/changelog updates.

Changes:

  • Introduce a new DINOv2 EoMT panoptic segmentation task model, training loop, transforms, scheduler, and loss.
  • Register the new training implementation so train_panoptic_segmentation(...) can select DINOv2 EoMT models.
  • Update docs/README/changelog and add a training + reload + predict smoke test for DINOv2 panoptic segmentation.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/_commands/test_train_task.py Adds a smoke test for DINOv2 EoMT panoptic segmentation training + reload + inference.
src/lightly_train/_task_models/dinov2_eomt_panoptic_segmentation/transforms.py Defines default train/val transform args and resolution/normalization auto-resolution for DINOv2 panoptic segmentation.
src/lightly_train/_task_models/dinov2_eomt_panoptic_segmentation/train_model.py Implements the TrainModel wrapper: optimizer/scheduler setup, training/validation steps, metrics wiring, and mask annealing.
src/lightly_train/_task_models/dinov2_eomt_panoptic_segmentation/task_model.py Implements the DINOv2 EoMT panoptic TaskModel (predict/forward/export_onnx/export_tensorrt, mask postprocessing, resize/pad).
src/lightly_train/_task_models/dinov2_eomt_panoptic_segmentation/scheduler.py Adds the EoMT two-stage warmup + poly LR schedule implementation.
src/lightly_train/_task_models/dinov2_eomt_panoptic_segmentation/scale_block.py Adds the upscaling block used by the mask head.
src/lightly_train/_task_models/dinov2_eomt_panoptic_segmentation/mask_loss.py Adds Mask2Former-based matching/loss wrapper used during training.
src/lightly_train/_task_models/dinov2_eomt_panoptic_segmentation/init.py Introduces the new task-model package.
src/lightly_train/_commands/train_task_helpers.py Registers the new DINOv2 panoptic TrainModel class in TASK_TRAIN_MODEL_CLASSES.
docs/source/panoptic_segmentation.md Documents DINOv2 panoptic EoMT models and includes generated default transform args.
docs/source/index.md Updates task overview to mention DINOv2 support for panoptic segmentation.
README.md Updates the capability matrix to mark DINOv2 panoptic segmentation as supported.
Makefile Extends license-header tooling configuration for the new derived EoMT files.
CHANGELOG.md Adds an entry announcing DINOv2 panoptic segmentation inference + fine-tuning support.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@guarin guarin enabled auto-merge (squash) March 9, 2026 07:46
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@guarin guarin merged commit 9a4db0c into main Mar 9, 2026
16 checks passed
@guarin guarin deleted the add-dinov2-panoptic-segmentation branch March 9, 2026 14:23
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