(self, arch=None, clean_resize: bool = False)
| 81 | |
| 82 | class DINOv2Encoder(Encoder): |
| 83 | def setup(self, arch=None, clean_resize: bool = False): |
| 84 | if arch is None: |
| 85 | arch = "vitl14" |
| 86 | |
| 87 | self.arch = arch |
| 88 | |
| 89 | arch_str = f"dinov2_{self.arch}" |
| 90 | |
| 91 | self.model = torch.hub.load("facebookresearch/dinov2", arch_str) |
| 92 | |
| 93 | def transform(self, image): |
| 94 |