()
| 2365 | # --------------------------------------------------------------------------- |
| 2366 | |
| 2367 | def main(): |
| 2368 | global SCENE_INDEX_DIR, SCENE_INDEX_PATH, BENCHMARK_ROOT |
| 2369 | |
| 2370 | parser = argparse.ArgumentParser(description="Benchmark GT Point Cloud Web Viewer") |
| 2371 | parser.add_argument("--scene-index", type=str, default=None, |
| 2372 | help="Scene index JSON, e.g. benchmark/scene_indices/all_scenes.json") |
| 2373 | parser.add_argument("--scene-index-dir", type=str, default="benchmark/scene_indices", |
| 2374 | help="Directory containing all_scenes.json (kept for backward compatibility)") |
| 2375 | parser.add_argument("--benchmark-root", type=str, default="SpatialBenchmark", |
| 2376 | help="SpatialBenchmark root containing single/sparse/medium/dense") |
| 2377 | parser.add_argument("--host", type=str, default="0.0.0.0") |
| 2378 | parser.add_argument("--port", type=int, default=8082) |
| 2379 | args = parser.parse_args() |
| 2380 | |
| 2381 | SCENE_INDEX_DIR = Path(args.scene_index_dir) |
| 2382 | SCENE_INDEX_PATH = ( |
| 2383 | Path(args.scene_index) |
| 2384 | if args.scene_index else |
| 2385 | SCENE_INDEX_DIR / "all_scenes.json" |
| 2386 | ) |
| 2387 | BENCHMARK_ROOT = Path(args.benchmark_root) |
| 2388 | |
| 2389 | _load_all_scenes() |
| 2390 | _init_benchmark_dataset() |
| 2391 | |
| 2392 | print(f"Scene index : {SCENE_INDEX_PATH.resolve()}") |
| 2393 | print(f"Benchmark : {BENCHMARK_ROOT.resolve()}") |
| 2394 | print(f"Total scenes: {len(_all_scenes)}") |
| 2395 | print(f"Datasets : {_dataset_names}") |
| 2396 | print(f"Server : http://localhost:{args.port}") |
| 2397 | |
| 2398 | uvicorn.run(app, host=args.host, port=args.port) |
| 2399 | |
| 2400 | |
| 2401 | if __name__ == "__main__": |
no test coverage detected