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

Class ToNumpy

timm/data/transforms.py:10–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 3

transforms_noaug_trainFunction · 0.90
transforms_imagenet_evalFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected