lightly-ai/lightly
Use InterpolationMode.BICUBIC instead of magic interpolation values in transforms
已關閉
#2,009 建立於 2026年7月30日
good first issuehelp wantedrefactor
倉庫指標
- 星標
- (3,775 顆星)
- PR 合併指標
- (PR 指標待抓取)
描述
lightly/transforms/ has two inconsistent ways of specifying bicubic interpolation for RandomResizedCrop:
interpolation=3—mae_transform.py,ijepa_transform.py,wmse_transform.py,capi_transform.pyinterpolation=PIL.Image.BICUBICwith 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.pylightly/transforms/ijepa_transform.pylightly/transforms/wmse_transform.pylightly/transforms/capi_transform.pylightly/transforms/dino_transform.pylightly/transforms/ibot_transform.py