MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / single2tensor3

Function single2tensor3

ldm/modules/image_degradation/utils_image.py:302–303  ·  view source on GitHub ↗
(img)

Source from the content-addressed store, hash-verified

300
301# convert single (HxWxC) to 3-dimensional torch tensor
302def single2tensor3(img):
303 return torch.from_numpy(np.ascontiguousarray(img)).permute(2, 0, 1).float()
304
305
306# convert single (HxWxC) to 4-dimensional torch tensor

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected