File size: 2,266 Bytes
37ee115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env python3
"""
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")
    
    # Check scene folder
    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
    
    # Check evaluation folder
    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)}")
    
    # Validation
    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)