-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtests.py
43 lines (33 loc) · 1.2 KB
/
tests.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
import numpy as np
from matplotlib import pyplot as plt
from pathfinder import PointCloud
import time
import logging
POINT_CLOUD_FILE = '../data/construction_site.las'
def perf_time_sample_size():
logging.disable()
x = np.arange(0.01, 0.2, 0.01)
y = np.array([])
for i in x:
start_time = time.time()
pc = PointCloud(filename=POINT_CLOUD_FILE, points_proportion=i)
e = pc.get_epsilon()
pc.apply_dbscan(e)
pc.write_path_output(f'test/perf_time_density_{i*100}.json', 5)
exec_time = (time.time() - start_time)
y = np.append(y, exec_time)
print(f'Computed path with {round(i * 100)}% of the points. Exec. time:\t{exec_time}\tseconds.')
plt.plot(x, y, ".")
plt.show()
def perf_clustering_sample_size():
logging.disable()
x = np.arange(1, 10, 1)
y = np.array([])
for i in x:
pc = PointCloud(filename=POINT_CLOUD_FILE, points_proportion=i/100)
e = pc.get_epsilon()
pc.apply_dbscan(e)
img = pc.generate_debug_image(1000, 1000, 3)
img.save(f'test/perf_clustering_sample_size/img_{int(i)}.png')
print(f"Computed clustering image img_{int(i)}.png")
perf_clustering_sample_size()