MCPcopy Create free account
hub / github.com/apple/ml-vivid / transform_coordinates

Function transform_coordinates

datautils.py:40–46  ·  view source on GitHub ↗
(K, camera_pose, new_size, center_crop_size, old_width=640, old_height=360)

Source from the content-addressed store, hash-verified

38
39
40def transform_coordinates(K, camera_pose, new_size, center_crop_size, old_width=640, old_height=360):
41 # crop operation
42 new_corner = torch.tensor([(old_width - center_crop_size) // 2, (old_height - center_crop_size) // 2])
43 K[:2, 2] = K[:2, 2] - new_corner
44 # resize operation
45 K[:2] = new_size * K[:2] / center_crop_size
46 return K, camera_pose
47
48
49def generate_rotation_matrix(generator, max_pitch: float, max_yaw: float, max_roll: float):

Callers 1

nvs_transformsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected