Find a dir that contains camera_params.json / depth/ / normal/ / *.ply.
(path: Path)
| 40 | |
| 41 | |
| 42 | def resolve_output_dir(path: Path) -> Path: |
| 43 | """Find a dir that contains camera_params.json / depth/ / normal/ / *.ply.""" |
| 44 | if (path / "camera_params.json").exists() or (path / "points.ply").exists(): |
| 45 | return path |
| 46 | # Walk down one or two levels to find the real output dir. |
| 47 | for lvl in range(3): |
| 48 | latest = pick_latest_subdir(path) |
| 49 | if latest == path: |
| 50 | break |
| 51 | path = latest |
| 52 | if (path / "camera_params.json").exists() or (path / "points.ply").exists(): |
| 53 | return path |
| 54 | return path |
| 55 | |
| 56 | |
| 57 | def read_ply_xyz(path: Path) -> Optional[np.ndarray]: |
no test coverage detected