| 248 | |
| 249 | |
| 250 | def parse_args(): |
| 251 | parser = argparse.ArgumentParser(description="GS PLY processing script") |
| 252 | |
| 253 | # Add arguments for preprocess, postprocess, and evaluate as optional flags |
| 254 | parser.add_argument("--preprocess", action="store_true", help="Perform preprocessing of the PLY file.") |
| 255 | parser.add_argument("--postprocess", action="store_true", help="Perform postprocessing (dequantization) of the PLY file.") |
| 256 | parser.add_argument("--evaluate", action="store_true", help="Perform evaluation of quantization error.") |
| 257 | |
| 258 | parser.add_argument("--raw_ply_path", type=str, help="Path to the raw input PLY file.") |
| 259 | parser.add_argument("--exp_dir", type=str, required=True, help="Directory to save output files.") |
| 260 | parser.add_argument("--colmap_path", type=str, help="Path to the COLMAP directory for evaluation poses (required if evaluate is true).") |
| 261 | |
| 262 | # Arguments for configurable filenames |
| 263 | parser.add_argument("--metadata_filename", type=str, default="metadata.json", |
| 264 | help="Filename for the metadata JSON file. Default is 'metadata.json'.") |
| 265 | parser.add_argument("--quantized_ply_filename", type=str, default="quantized.ply", |
| 266 | help="Filename for the quantized PLY output. Default is 'quantized.ply'.") |
| 267 | parser.add_argument("--dequantized_ply_filename", type=str, default="dequantized.ply", |
| 268 | help="Filename for the dequantized PLY output. Default is 'dequantized.ply'.") |
| 269 | |
| 270 | args = parser.parse_args() |
| 271 | |
| 272 | # Conditional check for --colmap_path |
| 273 | if args.evaluate and not args.colmap_path: |
| 274 | parser.error("--colmap_path is required when --evaluate is set.") |
| 275 | |
| 276 | return args |
| 277 | |
| 278 | if __name__ == "__main__": |
| 279 | args = parse_args() |