MCPcopy Create free account
hub / github.com/amazon-science/mm-cot / __call__

Method __call__

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected