(self, model_name: str, modulation_dim: int = None, freeze: bool = True)
| 26 | Dino v2 wrapper using original implementation, hacked with modulation. |
| 27 | """ |
| 28 | def __init__(self, model_name: str, modulation_dim: int = None, freeze: bool = True): |
| 29 | super().__init__() |
| 30 | self.modulation_dim = modulation_dim |
| 31 | self.model = self._build_dinov2(model_name, modulation_dim=modulation_dim) |
| 32 | if freeze: |
| 33 | if modulation_dim is not None: |
| 34 | raise ValueError("Modulated Dinov2 requires training, freezing is not allowed.") |
| 35 | self._freeze() |
| 36 | |
| 37 | def _freeze(self): |
| 38 | # logger.warning(f"======== Freezing Dinov2Wrapper ========") |
nothing calls this directly
no test coverage detected