forked from yindaz/DeepCompletionRelease
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils_scannet.lua
executable file
·52 lines (38 loc) · 1.41 KB
/
utils_scannet.lua
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
function loadRealsense(file_name, root_path)
print(string.format("Loading data from %s", file_name))
local output = {}
local file = io.open(file_name, "r")
for line in file:lines() do
local data = {}
baseline = root_path .. line
data.color = baseline .. '_color.png'
data.depth = baseline .. '_depth.png'
data.name = baseline
table.insert(output, data)
end
print(string.format("%d data loaded.",#output))
return output
end
function loadScanNetRender(file_name, root_path)
print(string.format("Loading data from %s", file_name))
local output = {}
local file = io.open(file_name, "r")
for line in file:lines() do
line = root_path .. line
local data = {}
baseline = line
data.color = baseline:gsub('data_dir', 'color'):gsub('_suffix', '.jpg');
baseline = line
data.nx = baseline:gsub('data_dir', 'mesh_images'):gsub('_suffix', '_mesh_nx.png');
data.ny = baseline:gsub('data_dir', 'mesh_images'):gsub('_suffix', '_mesh_ny.png');
data.nz = baseline:gsub('data_dir', 'mesh_images'):gsub('_suffix', '_mesh_nz.png');
baseline = line
data.depth = baseline:gsub('data_dir', 'mesh_images'):gsub('_suffix', '_mesh_depth.png');
baseline = line
data.depth_raw = baseline:gsub('data_dir', 'depth'):gsub('_suffix', '.png');
data.name = line
table.insert(output, data)
end
print(string.format("%d data loaded.",#output))
return output
end