Skip to content

Commit 8ffb458

Browse files
committed
fix(process): if no cluster, still need write label with initial.
1 parent b3071a3 commit 8ffb458

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

process.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ def run_cluster(
5454
for i in tqdm(range(bounds["min_index"], bounds["max_index"]+1), desc=f"Start Plus Cluster: {scene_in_data_index}/{len(all_scene_ids)}", ncols=80):
5555
data = dataset[i]
5656
pc0 = data['pc0'][:,:3]
57+
cluster_label = np.zeros(pc0.shape[0], dtype= np.int16)
58+
5759
if "dufo_label" not in data:
5860
print(f"Warning: {scene_id} {data['timestamp']} has no dufo_label, will be skipped. Better to rerun dufomap again in this scene.")
5961
continue
6062
elif data["dufo_label"].sum() < 20:
6163
print(f"Warning: {scene_id} {data['timestamp']} has no dynamic points, will be skipped. Better to check this scene.")
62-
continue
63-
64-
cluster_label = np.zeros(pc0.shape[0], dtype= np.int16)
65-
hdb.fit(pc0[data["dufo_label"]==1])
66-
# NOTE(Qingwen): since -1 will be assigned if no cluster. We set it to 0.
67-
cluster_label[data["dufo_label"]==1] = hdb.labels_ + 1
64+
else:
65+
hdb.fit(pc0[data["dufo_label"]==1])
66+
# NOTE(Qingwen): since -1 will be assigned if no cluster. We set it to 0.
67+
cluster_label[data["dufo_label"]==1] = hdb.labels_ + 1
6868

6969
# save labels
7070
timestamp = data['timestamp']

0 commit comments

Comments
 (0)