MCPcopy Create free account
hub / github.com/CompVis/zigma / Encoder

Class Encoder

utils/torchmetric_fdd.py:63–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61
62
63class Encoder(ABC, nn.Module):
64 def __init__(self, *args, **kwargs):
65 nn.Module.__init__(self)
66 self.setup(*args, **kwargs)
67 self.name = "encoder"
68
69 @abstractmethod
70 def setup(self, *args, **kwargs):
71 pass
72
73 @abstractmethod
74 def transform(self, x):
75 """Converts a PIL Image to an input for the model"""
76 pass
77
78 def forward(self, *args, **kwargs):
79 return self.model(*args, **kwargs)
80
81
82class DINOv2Encoder(Encoder):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected