(model_path, sh_degree=3, iteration=-1)
| 53 | |
| 54 | |
| 55 | def load_checkpoint(model_path, sh_degree=3, iteration=-1): |
| 56 | # Find checkpoint |
| 57 | checkpt_dir = os.path.join(model_path, "point_cloud") |
| 58 | if iteration == -1: |
| 59 | iteration = searchForMaxIteration(checkpt_dir) |
| 60 | checkpt_path = os.path.join( |
| 61 | checkpt_dir, f"iteration_{iteration}", "point_cloud.ply" |
| 62 | ) |
| 63 | |
| 64 | # Load guassians |
| 65 | gaussians = GaussianModel(sh_degree) |
| 66 | gaussians.load_ply(checkpt_path) |
| 67 | return gaussians |
| 68 | |
| 69 | |
| 70 | if __name__ == "__main__": |