MCPcopy Create free account
hub / github.com/apple/ml-sharp / create_eye_trajectory_swipe

Function create_eye_trajectory_swipe

src/sharp/utils/camera.py:109–121  ·  view source on GitHub ↗

Create a left to right swipe trajectory.

(
    offset_xyz_m: np.ndarray,
    distance_m: float,
    num_steps: int,
    num_repeats: int,
)

Source from the content-addressed store, hash-verified

107
108
109def create_eye_trajectory_swipe(
110 offset_xyz_m: np.ndarray,
111 distance_m: float,
112 num_steps: int,
113 num_repeats: int,
114) -> list[torch.Tensor]:
115 """Create a left to right swipe trajectory."""
116 offset_x_m, _, _ = offset_xyz_m
117 eye_positions = [
118 torch.tensor([x, 0, distance_m], dtype=torch.float32)
119 for x in np.linspace(-offset_x_m, offset_x_m, num_steps)
120 ]
121 return eye_positions * num_repeats
122
123
124def create_eye_trajectory_shake(

Callers 1

create_eye_trajectoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected