Skip to content

Commit 3f690ce

Browse files
committed
update README and example files
1 parent 9e826c2 commit 3f690ce

File tree

3 files changed

+33
-82
lines changed

3 files changed

+33
-82
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ lidar-labelling is a tool for automatic segmentation of raw lidar clouds based o
66

77
Our labelling algorithm consists of two stages.
88

9-
The first stage is a preliminary marking - a naive transfer of segmentation from images (performed by the [SAM](https://github.com/facebookresearch/segment-anything) algorithm) to the cloud. Then multi-stage processing of the cloud is performed, which allows us to make the cloud more compact before the final labelling without losing points that are significant for labelling. The preprocessing stages include removing points whose corresponding pixels were not marked on a sequence of images, selection of points close to the sensors, removal of noise, cloud voxelization.
9+
The first stage is a preliminary segmentation - a naive transfer of segmentation from images (performed by the [SAM](https://github.com/facebookresearch/segment-anything) algorithm) to the cloud. Then multi-stage processing of the cloud is performed, which allows us to make the cloud more compact before the final labelling without losing points that are significant for labelling. The preprocessing stages include removing points whose corresponding pixels were not marked on a sequence of images, selection of points close to the sensors, removal of noise, cloud voxelization.
1010

1111
The next stage is segmentation itself. The segmentation criterion in this work is the distance between points, which is calculated through the physical distance and the degree of similarity of the labelling of points on several images. Based on the distance matrix, the prepared cloud is segmented using the [GraphCut](https://ieeexplore.ieee.org/abstract/document/937505) algorithm.
1212

@@ -16,6 +16,11 @@ This tool currently supports processing of [KITTI](https://www.cvlibs.net/datase
1616
## Usage
1717
Please check `example.ipynb` with a example of cloud segmentation from the [KITTI](https://www.cvlibs.net/datasets/kitti/eval_odometry.php) dataset.
1818

19+
## Experiments
20+
Files for reproducing experiments are in folder `experiment`. You will need the [KITTI](https://www.cvlibs.net/datasets/kitti/eval_odometry.php) dataset with its folder structure and pre-performed image segmentation using the [SAM](https://github.com/facebookresearch/segment-anything) algorithm in npz format.
21+
22+
First run `main_kitti_processing.py` to generate segmentation with our algorithm. Then run `main_kitti_processing_metrics.py` to calculate the segmentation metrics of each run and write them to a csv file. Then run `main_calc_metrics_by_csv.py` to calculate the average values ​​of the metrics in the csv file.
23+
1924
## License
2025
This project is licensed under the Apache License —
2126
see the [LICENSE](https://github.com/prime-slam/lidar-labelling/blob/main/LICENSE) file for details.

example.ipynb

Lines changed: 24 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 1,
5+
"execution_count": null,
66
"metadata": {},
77
"outputs": [],
88
"source": [
@@ -16,7 +16,7 @@
1616
},
1717
{
1818
"cell_type": "code",
19-
"execution_count": 2,
19+
"execution_count": null,
2020
"metadata": {},
2121
"outputs": [],
2222
"source": [
@@ -32,7 +32,7 @@
3232
" \"start_image_index_offset\": 0,\n",
3333
" \"alpha_physical_distance\": 5,\n",
3434
" \"beta_instance_distance\": 5,\n",
35-
" \"T_normalized_cut\": 0.025,\n",
35+
" \"T_normalized_cut\": 0.02,\n",
3636
" \"reduce_detail_int_to_union_threshold\": 0.5,\n",
3737
" \"reduce_detail_int_to_mask_threshold\": 0.6,\n",
3838
" \"cam_name\": \"cam2\",\n",
@@ -46,7 +46,7 @@
4646
},
4747
{
4848
"cell_type": "code",
49-
"execution_count": 3,
49+
"execution_count": null,
5050
"metadata": {},
5151
"outputs": [],
5252
"source": [
@@ -61,27 +61,16 @@
6161
},
6262
{
6363
"cell_type": "code",
64-
"execution_count": 4,
64+
"execution_count": null,
6565
"metadata": {},
66-
"outputs": [
67-
{
68-
"data": {
69-
"text/plain": [
70-
"(498379, 4)"
71-
]
72-
},
73-
"execution_count": 4,
74-
"metadata": {},
75-
"output_type": "execute_result"
76-
}
77-
],
66+
"outputs": [],
7867
"source": [
7968
"points2instances.shape"
8069
]
8170
},
8271
{
8372
"cell_type": "code",
84-
"execution_count": 5,
73+
"execution_count": null,
8574
"metadata": {},
8675
"outputs": [],
8776
"source": [
@@ -98,7 +87,7 @@
9887
},
9988
{
10089
"cell_type": "code",
101-
"execution_count": 6,
90+
"execution_count": null,
10291
"metadata": {},
10392
"outputs": [],
10493
"source": [
@@ -117,7 +106,7 @@
117106
},
118107
{
119108
"cell_type": "code",
120-
"execution_count": 7,
109+
"execution_count": null,
121110
"metadata": {},
122111
"outputs": [],
123112
"source": [
@@ -135,7 +124,7 @@
135124
},
136125
{
137126
"cell_type": "code",
138-
"execution_count": 8,
127+
"execution_count": null,
139128
"metadata": {},
140129
"outputs": [],
141130
"source": [
@@ -152,7 +141,7 @@
152141
},
153142
{
154143
"cell_type": "code",
155-
"execution_count": 9,
144+
"execution_count": null,
156145
"metadata": {},
157146
"outputs": [],
158147
"source": [
@@ -165,7 +154,7 @@
165154
},
166155
{
167156
"cell_type": "code",
168-
"execution_count": 10,
157+
"execution_count": null,
169158
"metadata": {},
170159
"outputs": [],
171160
"source": [
@@ -182,7 +171,7 @@
182171
},
183172
{
184173
"cell_type": "code",
185-
"execution_count": 11,
174+
"execution_count": null,
186175
"metadata": {},
187176
"outputs": [],
188177
"source": [
@@ -207,27 +196,16 @@
207196
},
208197
{
209198
"cell_type": "code",
210-
"execution_count": 12,
199+
"execution_count": null,
211200
"metadata": {},
212-
"outputs": [
213-
{
214-
"data": {
215-
"text/plain": [
216-
"(3502, 3502)"
217-
]
218-
},
219-
"execution_count": 12,
220-
"metadata": {},
221-
"output_type": "execute_result"
222-
}
223-
],
201+
"outputs": [],
224202
"source": [
225203
"dist.shape"
226204
]
227205
},
228206
{
229207
"cell_type": "code",
230-
"execution_count": 13,
208+
"execution_count": null,
231209
"metadata": {},
232210
"outputs": [],
233211
"source": [
@@ -247,19 +225,9 @@
247225
},
248226
{
249227
"cell_type": "code",
250-
"execution_count": 14,
228+
"execution_count": null,
251229
"metadata": {},
252-
"outputs": [
253-
{
254-
"name": "stdout",
255-
"output_type": "stream",
256-
"text": [
257-
"(3502, 3502)\n",
258-
"3502\n",
259-
"3502\n"
260-
]
261-
}
262-
],
230+
"outputs": [],
263231
"source": [
264232
"print(dist.shape)\n",
265233
"print(len(points))\n",
@@ -268,7 +236,7 @@
268236
},
269237
{
270238
"cell_type": "code",
271-
"execution_count": 15,
239+
"execution_count": null,
272240
"metadata": {},
273241
"outputs": [],
274242
"source": [
@@ -287,48 +255,25 @@
287255
},
288256
{
289257
"cell_type": "code",
290-
"execution_count": 16,
258+
"execution_count": null,
291259
"metadata": {},
292-
"outputs": [
293-
{
294-
"data": {
295-
"text/plain": [
296-
"22"
297-
]
298-
},
299-
"execution_count": 16,
300-
"metadata": {},
301-
"output_type": "execute_result"
302-
}
303-
],
260+
"outputs": [],
304261
"source": [
305262
"len(clusters)"
306263
]
307264
},
308265
{
309266
"cell_type": "code",
310-
"execution_count": 17,
267+
"execution_count": null,
311268
"metadata": {},
312-
"outputs": [
313-
{
314-
"data": {
315-
"text/plain": [
316-
"array([ 206, 207, 456, 457, 496, 498, 1271, 1272, 1275, 1276, 1285,\n",
317-
" 1390, 1450, 1451, 1559, 1560, 1596, 1597, 2310, 2311])"
318-
]
319-
},
320-
"execution_count": 17,
321-
"metadata": {},
322-
"output_type": "execute_result"
323-
}
324-
],
269+
"outputs": [],
325270
"source": [
326271
"clusters[0]"
327272
]
328273
},
329274
{
330275
"cell_type": "code",
331-
"execution_count": 18,
276+
"execution_count": null,
332277
"metadata": {},
333278
"outputs": [],
334279
"source": [

example_gt.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
" \"start_image_index_offset\": 0,\n",
3434
" \"alpha_physical_distance\": 5,\n",
3535
" \"beta_instance_distance\": 5,\n",
36-
" \"T_normalized_cut\": 0.025,\n",
36+
" \"T_normalized_cut\": 0.02,\n",
3737
" \"reduce_detail_int_to_union_threshold\": 0.5,\n",
3838
" \"reduce_detail_int_to_mask_threshold\": 0.6,\n",
3939
" \"cam_name\": \"cam2\",\n",
@@ -398,7 +398,8 @@
398398
"outputs": [],
399399
"source": [
400400
"# an array of predictions\n",
401-
"# if instance_threshold percent or more of the cluster is in the gt instance, consider the cluster to be selected for comparison\n",
401+
"# if instance_threshold percent or more of the cluster is in the gt instance,\n",
402+
"# consider the cluster to be selected for comparison\n",
402403
"\n",
403404
"pred_inst_array = build_pred_inst_array(\n",
404405
" copy.deepcopy(inst_label_array_for_clustering),\n",

0 commit comments

Comments
 (0)