()
| 478 | |
| 479 | |
| 480 | def main(): |
| 481 | parser = argparse.ArgumentParser(description="Read and write COLMAP binary and text models") |
| 482 | parser.add_argument("--input_model", help="path to input model folder") |
| 483 | parser.add_argument("--input_format", choices=[".bin", ".txt"], |
| 484 | help="input model format", default="") |
| 485 | parser.add_argument("--output_model", |
| 486 | help="path to output model folder") |
| 487 | parser.add_argument("--output_format", choices=[".bin", ".txt"], |
| 488 | help="outut model format", default=".txt") |
| 489 | args = parser.parse_args() |
| 490 | |
| 491 | cameras, images, points3D = read_model(path=args.input_model, ext=args.input_format) |
| 492 | |
| 493 | print("num_cameras:", len(cameras)) |
| 494 | print("num_images:", len(images)) |
| 495 | print("num_points3D:", len(points3D)) |
| 496 | |
| 497 | if args.output_model is not None: |
| 498 | write_model(cameras, images, points3D, path=args.output_model, ext=args.output_format) |
| 499 | |
| 500 | |
| 501 | if __name__ == "__main__": |
no test coverage detected