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