MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / transform

Function transform

tools/preprocess/pose2d_utils.py:991–998  ·  view source on GitHub ↗

Transform pixel location to different reference.

(pt, center, scale, res, invert=0, rot=0)

Source from the content-addressed store, hash-verified

989
990
991def transform(pt, center, scale, res, invert=0, rot=0):
992 """Transform pixel location to different reference."""
993 t = get_transform(center, scale, res, rot=rot)
994 if invert:
995 t = np.linalg.inv(t)
996 new_pt = np.array([pt[0] - 1, pt[1] - 1, 1.0]).T
997 new_pt = np.dot(t, new_pt)
998 return np.array([round(new_pt[0]), round(new_pt[1])], dtype=int) + 1
999
1000
1001def bbox_from_detector(bbox, input_resolution=(224, 224), rescale=1.25):

Callers 2

cropFunction · 0.85
run_depth_midas_smallFunction · 0.85

Calls 1

get_transformFunction · 0.85

Tested by

no test coverage detected