MCPcopy Create free account
hub / github.com/bbaaii/DreamDiffusion / normalize2

Function normalize2

code/dataset.py:355–360  ·  view source on GitHub ↗
(img)

Source from the content-addressed store, hash-verified

353
354
355def normalize2(img):
356 if img.shape[-1] == 3:
357 img = rearrange(img, 'h w c -> c h w')
358 img = torch.tensor(img)
359 img = img * 2.0 - 1.0 # to -1 ~ 1
360 return img
361
362
363

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected