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

Function refine_shift

lib/test_utils.py:120–128  ·  view source on GitHub ↗
(depth_wshift, model, focal, u0, v0)

Source from the content-addressed store, hash-verified

118 return torch.tensor([[last_scale]])
119
120def refine_shift(depth_wshift, model, focal, u0, v0):
121 depth_wshift_tmp = np.copy(depth_wshift)
122 last_shift = 0
123 for i in range(1):
124 shift = refine_shift_one_step(depth_wshift_tmp, model, focal, u0, v0)
125 shift = shift if shift.item() < 0.7 else torch.tensor([[0.7]])
126 depth_wshift_tmp -= shift.item()
127 last_shift += shift.item()
128 return torch.tensor([[last_shift]])
129
130def reconstruct_3D(depth, f):
131 """

Callers

nothing calls this directly

Calls 1

refine_shift_one_stepFunction · 0.85

Tested by

no test coverage detected