lightly-ai/lightly

Use InterpolationMode.BICUBIC instead of magic interpolation values in transforms

Geschlossen

#2.009 geöffnet am 30.07.2026

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (337 Forks)auto 404
good first issuehelp wantedrefactor

Repository-Metriken

Stars
 (3.775 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

lightly/transforms/ has two inconsistent ways of specifying bicubic interpolation for RandomResizedCrop:

  • interpolation=3mae_transform.py, ijepa_transform.py, wmse_transform.py, capi_transform.py
  • interpolation=PIL.Image.BICUBIC with a # type: ignore[attr-defined]dino_transform.py, ibot_transform.py

Both should become:

T.RandomResizedCrop(input_size, scale=(min_scale, 1.0), interpolation=T.InterpolationMode.BICUBIC)

T is torchvision_transforms from lightly.transforms.torchvision_v2_compatibility, already imported in every affected file, and T.InterpolationMode.BICUBIC resolves under both the v1 and v2 compatibility paths. No new import needed, and it drops the type: ignore in the DINO/iBOT files.

Files to update:

  • lightly/transforms/mae_transform.py
  • lightly/transforms/ijepa_transform.py
  • lightly/transforms/wmse_transform.py
  • lightly/transforms/capi_transform.py
  • lightly/transforms/dino_transform.py
  • lightly/transforms/ibot_transform.py

Contributor Guide