This commit is contained in:
HuguesTHOMAS 2022-04-04 17:43:20 -04:00
parent 9a18c66ba8
commit 5b5641e02d

View file

@ -253,6 +253,7 @@ class S3DISDataset(PointCloudDataset):
s_list = [] s_list = []
R_list = [] R_list = []
batch_n = 0 batch_n = 0
failed_attempts = 0
info = get_worker_info() info = get_worker_info()
if info is not None: if info is not None:
@ -342,6 +343,9 @@ class S3DISDataset(PointCloudDataset):
# Safe check for empty spheres # Safe check for empty spheres
if n < 2: if n < 2:
failed_attempts += 1
if failed_attempts > 2 * self.config.batch_num:
raise ValueError('It seems this dataset only containes empty input spheres')
t += [time.time()] t += [time.time()]
t += [time.time()] t += [time.time()]
continue continue
@ -510,6 +514,7 @@ class S3DISDataset(PointCloudDataset):
s_list = [] s_list = []
R_list = [] R_list = []
batch_n = 0 batch_n = 0
failed_attempts = 0
while True: while True:
@ -541,6 +546,13 @@ class S3DISDataset(PointCloudDataset):
# Number collected # Number collected
n = input_inds.shape[0] n = input_inds.shape[0]
# Safe check for empty spheres
if n < 2:
failed_attempts += 1
if failed_attempts > 2 * self.config.batch_num:
raise ValueError('It seems this dataset only containes empty input spheres')
continue
# Collect labels and colors # Collect labels and colors
input_points = (points[input_inds] - center_point).astype(np.float32) input_points = (points[input_inds] - center_point).astype(np.float32)