pipeline for single cluster

This commit is contained in:
Si11ium
2020-06-24 10:49:10 +02:00
parent 85cf3128f1
commit 965b805ee9
3 changed files with 6 additions and 6 deletions

@ -72,7 +72,7 @@ if __name__ == '__main__':
test_dataset = ShapeNetPartSegDataset('data', mode=GlobalVar.data_split.predict, collate_per_segment=False,
refresh=True, transform=transforms)
grid_clusters = cluster_cubes(test_dataset[1], [3, 3, 3], max_points_per_cluster=1024)
grid_clusters = cluster_cubes(test_dataset[1], [1, 1, 1], max_points_per_cluster=32768)
ps.init()

@ -25,7 +25,7 @@ class PointNet2(BaseValMixin,
# Dataset
# =============================================================================
# rot_max_angle = 15
trans_max_distance = 0.01
trans_max_distance = 0.02
transforms = Compose(
[
RandomFlip(0, p=0.8),

@ -103,10 +103,6 @@ def cluster_per_column(pc, column):
def cluster_cubes(data, cluster_dims, max_points_per_cluster=-1, min_points_per_cluster=-1):
if cluster_dims[0] == 1 and cluster_dims[1] == 1 and cluster_dims[2] == 1:
print("no need to cluster.")
return [farthest_point_sampling(data, max_points_per_cluster)]
if isinstance(data, Data):
import torch
candidate_list = list()
@ -119,6 +115,10 @@ def cluster_cubes(data, cluster_dims, max_points_per_cluster=-1, min_points_per_
data = torch.cat(candidate_list, dim=-1).numpy()
if cluster_dims[0] == 1 and cluster_dims[1] == 1 and cluster_dims[2] == 1:
print("no need to cluster.")
return [farthest_point_sampling(data, max_points_per_cluster)]
max = data[:, :3].max(axis=0)
max += max * 0.01