-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtreeiso_evaluation.py
More file actions
31 lines (23 loc) · 1.11 KB
/
treeiso_evaluation.py
File metadata and controls
31 lines (23 loc) · 1.11 KB
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
import os
import open3d as o3d
from fire import Fire
from base_evaluation import BaseEvaluation
class TreeIsoEvaluation(BaseEvaluation):
def __init__(self, data_base_dir= "/Stor1/wout/BenchmarkPaper/data/", dataset="WYTHAM", use_cached_calculations=True, cache_calculations=True, debug=False, output_file="final/result.ply"):
self.method="treeiso"
self.output_file = output_file
super(TreeIsoEvaluation, self).__init__(data_base_dir, dataset, use_cached_calculations, cache_calculations, debug)
return
def read_output(self):
'''
Read output TreeIso Seg method
Output format TreeIso Seg: Single ply with instances under 'scalar_final_segs'
Output format:
[tree1, tree2, ...] where treen is an o3d instance of tree
'''
input_file = os.path.join(self.output_dir, self.output_file)
input_pc = o3d.t.io.read_point_cloud(input_file)
predictions = self.seperate_labeled_instances(input_pc, instance_label="scalar_final_segs")
return predictions
if __name__ == "__main__":
Fire(TreeIsoEvaluation)