MCPcopy Create free account
hub / github.com/DSL-Lab/StreamSplat / PILtoTorch

Function PILtoTorch

utils/general_utils.py:24–30  ·  view source on GitHub ↗
(pil_image, resolution)

Source from the content-addressed store, hash-verified

22 return torch.log(x/(1-x))
23
24def PILtoTorch(pil_image, resolution):
25 resized_image_PIL = pil_image.resize(resolution)
26 resized_image = torch.from_numpy(np.array(resized_image_PIL)) / 255.0
27 if len(resized_image.shape) == 3:
28 return resized_image.permute(2, 0, 1)
29 else:
30 return resized_image.unsqueeze(dim=-1).permute(2, 0, 1)
31
32def get_expon_lr_func(
33 lr_init, lr_final, lr_delay_steps=0, lr_delay_mult=1.0, max_steps=1000000

Callers 2

loadCamFunction · 0.90
__getitem__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected