| |
| """ |
| Inspect 3DMatch redkitchen dataset |
| """ |
| import os |
| import sys |
| from pathlib import Path |
|
|
| def inspect_redkitchen(raw_root): |
| """Inspect redkitchen dataset""" |
| raw_root = Path(raw_root) |
| |
| if not raw_root.exists(): |
| print(f"Error: {raw_root} does not exist") |
| return False |
| |
| scene_dir = raw_root / '7-scenes-redkitchen' |
| eval_dir = raw_root / '7-scenes-redkitchen-evaluation' |
| |
| ply_files = [] |
| log_files = [] |
| |
| print("=== 3DMatch Redkitchen Inspection ===\n") |
| |
| |
| if scene_dir.exists(): |
| print(f"β Scene folder: {scene_dir.name}") |
| for root, dirs, files in os.walk(scene_dir): |
| for f in files: |
| if f.endswith('.ply'): |
| ply_files.append(Path(root) / f) |
| else: |
| print(f"β Scene folder not found: {scene_dir}") |
| return False |
| |
| |
| if eval_dir.exists(): |
| print(f"β Evaluation folder: {eval_dir.name}") |
| for root, dirs, files in os.walk(eval_dir): |
| for f in files: |
| if f.endswith('.log'): |
| log_files.append(Path(root) / f) |
| else: |
| print(f"β Evaluation folder not found: {eval_dir}") |
| return False |
| |
| print(f"\nPLY files: {len(ply_files)}") |
| if ply_files: |
| for ply in sorted(ply_files)[:5]: |
| print(f" - {ply.relative_to(raw_root)}") |
| if len(ply_files) > 5: |
| print(f" ... and {len(ply_files) - 5} more") |
| |
| print(f"\nLog files: {len(log_files)}") |
| for log in sorted(log_files): |
| print(f" - {log.relative_to(raw_root)}") |
| |
| |
| success = True |
| if len(ply_files) == 0: |
| print("\nβ No .ply files found!") |
| success = False |
| else: |
| print(f"\nβ Found {len(ply_files)} point clouds") |
| |
| if len(log_files) == 0: |
| print("β No evaluation .log files found!") |
| success = False |
| else: |
| print(f"β Found {len(log_files)} evaluation log(s)") |
| |
| return success |
|
|
| if __name__ == '__main__': |
| raw_root = sys.argv[1] if len(sys.argv) > 1 else 'data/raw/3dmatch' |
| success = inspect_redkitchen(raw_root) |
| sys.exit(0 if success else 1) |
|
|