MCPcopy Create free account
hub / github.com/NVlabs/InstantSplat / PILtoTorch

Function PILtoTorch

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

Source from the content-addressed store, hash-verified

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

Callers 1

loadCamFunction · 0.90

Calls 1

resizeMethod · 0.80

Tested by

no test coverage detected