Load the backbone with pretrained dinov2 weights from torch hub
(self)
| 242 | return model |
| 243 | |
| 244 | def init_weights(self): |
| 245 | "Load the backbone with pretrained dinov2 weights from torch hub" |
| 246 | state_dict = torch.hub.load('facebookresearch/dinov2', self.encoder, pretrained=True).state_dict() |
| 247 | self.backbone.load_state_dict(state_dict) |
| 248 | |
| 249 | def enable_gradient_checkpointing(self): |
| 250 | for i in range(len(self.backbone.blocks)): |
nothing calls this directly
no outgoing calls
no test coverage detected