Skip to content

Docs: add an AlbumentationsX tutorial for custom DINO views - #2048

Draft
ternaus wants to merge 1 commit into
lightly-ai:masterfrom
ternaus:codex/docs-ax-dino-multiview
Draft

Docs: add an AlbumentationsX tutorial for custom DINO views#2048
ternaus wants to merge 1 commit into
lightly-ai:masterfrom
ternaus:codex/docs-ax-dino-multiview

Conversation

@ternaus

@ternaus ternaus commented Aug 29, 2026

Copy link
Copy Markdown

Closes #2047

Description

  • My change is breaking

Adds a standalone Sphinx Gallery tutorial for customizing DINO view policies with AlbumentationsX while retaining Lightly's current MultiViewTransform, dataset, model, and training contracts.

The tutorial:

  • defines separate policies for the two global views and the repeated local-view role, including DINO's blur and solarization differences;
  • exposes crop ratio, crop scale, and the photometric composition without copying DINOTransform;
  • adapts Lightly's PIL input to the tensor produced by A.ToTensorV2();
  • demonstrates two global and six independently sampled local views; and
  • serializes each configured policy with A.to_dict().

This is documentation-only. AlbumentationsX remains an optional dependency and is not added to Lightly's package metadata.

Tests

  • My change is covered by existing tests.
  • My change needs new tests.
  • I have added/adapted the tests accordingly.
  • I have manually tested the change.

Validation performed:

  • executed the complete tutorial with public albumentationsx==2.4.3;
  • verified two 3 x 224 x 224 global tensors and six 3 x 96 x 96 local tensors;
  • verified the policy serialization round trip;
  • ran pytest -q tests/transforms/test_multi_view_transform.py tests/transforms/test_dino_transform.py (3 passed);
  • ran make format-check;
  • ran all pre-commit hooks on the changed files;
  • built the docs with make html-noplot; and
  • executed this tutorial through Sphinx Gallery to verify its generated figure and output.

The repository-wide pre-commit run reaches an existing codespell failure in unchanged lightly/loss/frossl_loss.py:90 (fro). All hooks pass on the files in this PR.

Documentation

  • I have added docstrings to all public functions/methods.
  • My change requires a change to the documentation (.rst files).
  • I have updated the documentation accordingly.
  • The autodocs update the documentation accordingly.

The generated tutorial page and all eight pages of its PDF preview were inspected for clipping, overlap, and broken layout.

Implications / comments / further issues

  • The tutorial targets the current API, following the guidance in Tutorial proposal: customize and inspect DINO views with AlbumentationsX #2047.
  • It documents Python 3.10+, the user-selected PyTorch build, and the AGPL-3.0-only license at the optional dependency boundary.
  • OpenCV and torchvision can differ pixel-wise for nominally equivalent transforms; the tutorial states this explicitly and recommends downstream evaluation for policy changes.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Document role-specific global and local view policies with the current MultiViewTransform contract. Show independent repeated local sampling and policy serialization.
@ternaus
ternaus force-pushed the codex/docs-ax-dino-multiview branch from 4d2a41e to a5ad712 Compare August 29, 2026 11:47
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.

Tutorial proposal: customize and inspect DINO views with AlbumentationsX

1 participant