(poses, bds)
| 206 | return pose_avg |
| 207 | |
| 208 | def generate_render_pose(poses, bds): |
| 209 | idx = np.random.choice(poses.shape[0]) |
| 210 | c2w=poses[idx] |
| 211 | print(c2w[:3,:4]) |
| 212 | |
| 213 | ## Get spiral |
| 214 | # Get average pose |
| 215 | up = normalize(poses[:, :3, 1].sum(0)) |
| 216 | |
| 217 | # Find a reasonable "focus depth" for this dataset |
| 218 | close_depth, inf_depth = bds.min()*.9, bds.max()*5. |
| 219 | dt = .75 |
| 220 | mean_dz = 1./(((1.-dt)/close_depth + dt/inf_depth)) |
| 221 | focal = mean_dz |
| 222 | |
| 223 | # Get radii for spiral path |
| 224 | shrink_factor = .8 |
| 225 | zdelta = close_depth * .2 |
| 226 | tt = poses[:,:3,3] # ptstocam(poses[:3,3,:].T, c2w).T |
| 227 | rads = np.percentile(np.abs(tt), 20, 0) # views of 20 degrees |
| 228 | c2w_path = c2w |
| 229 | N_views = 120 # number of views in video |
| 230 | N_rots = 2 |
| 231 | |
| 232 | # Generate poses for spiral path |
| 233 | render_poses = render_path_spiral(c2w_path, up, rads, focal, zdelta, zrate=.5, rots=N_rots, N=N_views) |
| 234 | return render_poses |
| 235 | |
| 236 | def perturb_render_pose(poses, bds, x, angle): |
| 237 | """ |
nothing calls this directly
no test coverage detected