forked from scannetpp/scannetpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scene_release.py
170 lines (136 loc) · 4.21 KB
/
scene_release.py
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
from pathlib import Path
class ScannetppScene_Release:
def __init__(self, scene_id, data_root=None):
self._scene_id = scene_id
self.data_root = self.path_or_none(data_root)
@staticmethod
def path_or_none(path):
if path is not None:
path = Path(path)
return path
@property
def scene_id(self):
return self._scene_id
# dir containing all data for this scene
@property
def scene_root_dir(self):
return self.data_root / self._scene_id
##### scan assets #####
@property
def scans_dir(self):
'''
dir containing all scan-related data
'''
return self.data_root / self._scene_id / 'scans'
@property
def pc_dir(self):
'''
dir containing 1mm point cloud
'''
return self.scans_dir
@property
def scan_pc_path(self):
'''
path to point cloud
'''
return self.pc_dir / 'pc_aligned.ply'
@property
def scan_pc_mask_path(self):
'''
path to the point cloud mask
'''
return self.pc_dir / 'pc_aligned_mask.txt'
@property
def scan_transformed_poses_path(self):
'''
path containing all scanner poses transformed to aligned coordinates
in a single file
'''
return self.pc_dir / 'scanner_poses.json'
@property
def mesh_dir(self):
'''
dir containing all the meshes and related data
put meshes in the same dir as 1mm PCs
'''
return self.scans_dir
@property
def scan_mesh_path(self):
'''
path to the mesh
'''
return self.mesh_dir / 'mesh_aligned_0.05.ply'
@property
def scan_mesh_mask_path(self):
'''
path to the mesh mask
'''
return self.mesh_dir / 'mesh_aligned_0.05_mask.txt'
@property
def scan_mesh_segs_path(self):
return self.mesh_dir / f'segments.json'
@property
def scan_anno_json_path(self):
return self.mesh_dir / f'segments_anno.json'
@property
def scan_sem_mesh_path(self):
return self.mesh_dir / f'mesh_aligned_0.05_semantic.ply'
######## DSLR ########
@property
def dslr_dir(self):
return self.data_root / self._scene_id / 'dslr'
@property
def dslr_resized_dir(self):
return self.dslr_dir / 'resized_images'
@property
def dslr_resized_mask_dir(self):
return self.dslr_dir / 'resized_anon_masks'
@property
def dslr_original_dir(self):
return self.dslr_dir / 'original_images'
@property
def dslr_original_mask_dir(self):
return self.dslr_dir / 'original_anon_masks'
@property
def dslr_colmap_dir(self):
return self.dslr_dir / 'colmap'
@property
def dslr_nerfstudio_transform_path(self):
return self.dslr_dir / 'nerfstudio' / 'transforms.json'
@property
def dslr_train_test_lists_path(self):
return self.dslr_dir / 'train_test_lists.json'
##### iphone #####
@property
def iphone_data_dir(self):
return self.data_root / self._scene_id / 'iphone'
@property
def iphone_video_path(self):
return self.iphone_data_dir / 'rgb.mp4'
@property
def iphone_rgb_dir(self):
return self.iphone_data_dir / 'rgb'
@property
def iphone_video_mask_path(self):
return self.iphone_data_dir / 'rgb_mask.mkv'
@property
def iphone_video_mask_dir(self):
return self.iphone_data_dir / 'rgb_masks'
@property
def iphone_depth_path(self):
return self.iphone_data_dir / 'depth.bin'
@property
def iphone_depth_dir(self):
return self.iphone_data_dir / 'depth'
@property
def iphone_pose_intrinsic_imu_path(self):
return self.iphone_data_dir / 'pose_intrinsic_imu.json'
@property
def iphone_colmap_dir(self):
return self.iphone_data_dir / 'colmap'
@property
def iphone_nerfstudio_transform_path(self):
return self.iphone_data_dir / 'nerfstudio' / 'transforms.json'
@property
def iphone_exif_path(self):
return self.iphone_data_dir / 'exif.json'