MCPcopy Create free account
hub / github.com/QWTforGithub/T2LDM / __call__

Method __call__

timm/data/transforms.py:30–35  ·  view source on GitHub ↗
(self, pil_img)

Source from the content-addressed store, hash-verified

28 self.dtype = dtype
29
30 def __call__(self, pil_img):
31 np_img = np.array(pil_img, dtype=np.uint8)
32 if np_img.ndim < 3:
33 np_img = np.expand_dims(np_img, axis=-1)
34 np_img = np.rollaxis(np_img, 2) # HWC to CHW
35 return torch.from_numpy(np_img).to(dtype=self.dtype)
36
37
38_pil_interpolation_to_str = {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected