MCPcopy Create free account
hub / github.com/Monalissaa/DisenDiff / _transform_test

Method _transform_test

utils/clipscore/clipscore.py:88–95  ·  view source on GitHub ↗
(self, n_px)

Source from the content-addressed store, hash-verified

86 self.preprocess = self._transform_test(224)
87
88 def _transform_test(self, n_px):
89 return Compose([
90 Resize(n_px, interpolation=Image.BICUBIC),
91 CenterCrop(n_px),
92 lambda image: image.convert("RGB"),
93 ToTensor(),
94 Normalize((0.48145466, 0.4578275, 0.40821073), (0.26862954, 0.26130258, 0.27577711)),
95 ])
96
97 def __getitem__(self, idx):
98 c_data = self.data[idx]

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected