MCPcopy Create free account
hub / github.com/DSL-Lab/GRBM / unnormalize_img_tuple

Function unnormalize_img_tuple

utils.py:51–56  ·  view source on GitHub ↗
(img_tuple, mean, std)

Source from the content-addressed store, hash-verified

49
50
51def unnormalize_img_tuple(img_tuple, mean, std):
52 if isinstance(std, torch.Tensor):
53 mean = mean.view(1, -1, 1, 1).to(img_tuple[0][1].device)
54 std = std.view(1, -1, 1, 1).to(img_tuple[0][1].device)
55
56 return [(xx[0], (xx[1] * std + mean).clamp(min=0, max=1)) for xx in img_tuple]
57
58
59def fig2img(fig):

Callers 1

visualize_samplingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected