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

Class ToNumpy

timm/data/transforms.py:15–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13
14
15class ToNumpy:
16
17 def __call__(self, pil_img):
18 np_img = np.array(pil_img, dtype=np.uint8)
19 if np_img.ndim < 3:
20 np_img = np.expand_dims(np_img, axis=-1)
21 np_img = np.rollaxis(np_img, 2) # HWC to CHW
22 return np_img
23
24
25class ToTensor:

Callers 3

transforms_noaug_trainFunction · 0.90
transforms_imagenet_evalFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected