MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / fn

Function fn

eval_code/recons/models/moge/utils/geometry_numpy.py:84–88  ·  view source on GitHub ↗
(uv: np.ndarray, xy: np.ndarray, z: np.ndarray, shift: np.ndarray)

Source from the content-addressed store, hash-verified

82 uv, xy, z = uv.reshape(-1, 2), xyz[..., :2].reshape(-1, 2), xyz[..., 2].reshape(-1)
83
84 def fn(uv: np.ndarray, xy: np.ndarray, z: np.ndarray, shift: np.ndarray):
85 xy_proj = xy / (z + shift)[: , None]
86 f = (xy_proj * uv).sum() / np.square(xy_proj).sum()
87 err = (f * xy_proj - uv).ravel()
88 return err
89
90 solution = least_squares(partial(fn, uv, xy, z), x0=0, ftol=1e-3, method='lm')
91 optim_shift = solution['x'].squeeze().astype(np.float32)

Callers 13

split_batch_fwdFunction · 0.85
named_applyFunction · 0.85
__call__Method · 0.85
wrapperFunction · 0.85
_fnFunction · 0.85
wrapperMethod · 0.85
split_batch_fwdFunction · 0.85
wrapperFunction · 0.85
wrapperMethod · 0.85
_call_based_on_argsFunction · 0.85
named_applyFunction · 0.85
named_applyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected