MCPcopy Create free account
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / convert2tensor

Function convert2tensor

inpaint/mesh_tools.py:1075–1083  ·  view source on GitHub ↗
(input_dict)

Source from the content-addressed store, hash-verified

1073 return omaps
1074
1075def convert2tensor(input_dict):
1076 rt_dict = {}
1077 for key, value in input_dict.items():
1078 if 'rgb' in key or 'color' in key:
1079 rt_dict[key] = torch.FloatTensor(value).permute(2, 0, 1)[None, ...]
1080 else:
1081 rt_dict[key] = torch.FloatTensor(value)[None, None, ...]
1082
1083 return rt_dict

Callers 3

DL_inpaint_edgeFunction · 0.90
edge_inpaintingFunction · 0.85
depth_inpaintingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected