Skip to content

Commit 4cf1168

Browse files
committed
docs: update README with icp-flow in the official implementation.
* conf(optimization-based): update all config files. * todo: update model file, double check with yancong and Qingwen confirm that: icp-flow results can be reproduced and tested.
1 parent b29f50b commit 4cf1168

5 files changed

Lines changed: 115 additions & 4 deletions

File tree

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ International Conference on Robotics and Automation (**ICRA**) 2025
3131
European Conference on Computer Vision (**ECCV**) 2024
3232
[ Strategy ] [ Self-Supervised ] - [ [arXiv](https://arxiv.org/abs/2407.01702) ] [ [Project](https://github.com/KTH-RPL/SeFlow) ] → [here](#seflow)
3333

34+
- **ICP-Flow: LiDAR Scene Flow Estimation with ICP**
35+
*Yancong Lin, Holger Caesar*
36+
Conference on Computer Vision and Pattern Recognition (**CVPR**) 2024
37+
[ Optimization-based ] [ Self-Supervised ] - [ [arXiv](https://arxiv.org/abs/2402.17351) ] [ [Project](https://github.com/yanconglin/ICP-Flow) ] → [here](#icp-flow)
38+
3439
- **DeFlow: Decoder of Scene Flow Network in Autonomous Driving**
3540
*Qingwen Zhang, Yi Yang, Heng Fang, Ruoyu Geng, Patric Jensfelt*
3641
International Conference on Robotics and Automation (**ICRA**) 2024
@@ -45,7 +50,6 @@ Additionally, *OpenSceneFlow* integrates following excellent works: [ICLR'24 Zer
4550
- [x] [ZeroFlow](https://arxiv.org/abs/2305.10424): ICLR 2024, their pre-trained weight can covert into our format easily through [the script](tools/zerof2ours.py).
4651
- [x] [NSFP](https://arxiv.org/abs/2111.01253): NeurIPS 2021, faster 3x than original version because of [our CUDA speed up](assets/cuda/README.md), same (slightly better) performance.
4752
- [x] [FastNSF](https://arxiv.org/abs/2304.09121): ICCV 2023. SSL optimization-based.
48-
- [ ] [ICP-Flow](https://arxiv.org/abs/2402.17351): CVPR 2024. SSL optimization-based. Done coding, public after review.
4953

5054
</details>
5155

@@ -143,7 +147,7 @@ wget https://huggingface.co/kin-zhang/OpenSceneFlow/resolve/main/flow4d_best.ckp
143147

144148
### SSF
145149

146-
Extra pakcges needed for SSF model:
150+
Extra packages needed for SSF model:
147151
```bash
148152
pip install mmengine-lite torch-scatter
149153
# torch-scatter might not working, then reinstall by:
@@ -179,6 +183,21 @@ Pretrained weight can be downloaded through:
179183
wget https://huggingface.co/kin-zhang/OpenSceneFlow/resolve/main/seflow_best.ckpt
180184
```
181185

186+
### ICP-Flow
187+
188+
ICP-Flow is a optimization-based method, you can directly run `eval.py`/`save.py` to get the result.
189+
190+
Extra packages needed for ICP-Flow model:
191+
```bash
192+
pip install pytorch3d assets/cuda/histlib
193+
```
194+
195+
Then run as:
196+
```bash
197+
python eval.py model=icpflow
198+
python save.py model=icpflow
199+
```
200+
182201
### DeFlow
183202

184203
Train DeFlow with the leaderboard submit config. [Runtime: Around 6-8 hours in 4x A100 GPUs.] Please change `batch_size&lr` accoordingly if you don't have enough GPU memory. (e.g. `batch_size=6` for 24GB GPU)
@@ -327,6 +346,12 @@ And our excellent collaborators works contributed to this codebase also:
327346
journal={arXiv preprint arXiv:2501.17821},
328347
year={2025}
329348
}
349+
@article{lin2024icp,
350+
title={ICP-Flow: LiDAR Scene Flow Estimation with ICP},
351+
author={Lin, Yancong and Caesar, Holger},
352+
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
353+
year={2024}
354+
}
330355
```
331356

332357
Thank you for your support! ❤️

assets/cuda/histlib/__init__.py

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
from torch import nn
2+
from torch.autograd import Function
3+
import torch
4+
import importlib
5+
6+
import os, time
7+
import hist
8+
9+
def histf(X, Y, min_x, min_y, min_z, max_x, max_y, max_z, len_x, len_y, len_z, mini_batch=8):
10+
# print('hist cuda params: ', X.shape, Y.shape,
11+
# min_x, min_y, min_z,
12+
# max_x, max_y, max_z,
13+
# len_x, len_y, len_z,
14+
# )
15+
histogram = hist.hist(X.contiguous(), Y.contiguous(),
16+
min_x, min_y, min_z,
17+
max_x, max_y, max_z,
18+
len_x, len_y, len_z,
19+
mini_batch
20+
)
21+
return histogram
22+
23+
24+
torch.manual_seed(2022)
25+
26+
########################
27+
def run_test():
28+
pts = torch.randn(3, 1000, 3)
29+
indicators = torch.randint(0, 2, size=(3, 1000, 1))
30+
pts1 = torch.cat([pts, indicators], dim=-1)
31+
pts2 = pts1.clone()
32+
pts2[:, :,0] += 5.
33+
pts2[:, :,1] += -3.
34+
pts2[:, :,2] += -0.2
35+
36+
range_x = 10.
37+
range_y = 10.
38+
range_z = 0.5
39+
thres =0.1
40+
# bins_x = torch.linspace(-range_x, range_x, int(2*range_x/thres)+1)
41+
# bins_y = torch.linspace(-range_y, range_y, int(2*range_y/thres)+1)
42+
# bins_z = torch.linspace(-range_z, range_z, int(2*range_z/thres)+1)
43+
bins_x = torch.arange(-range_x, range_x+thres, thres)
44+
bins_y = torch.arange(-range_y, range_y+thres, thres)
45+
bins_z = torch.arange(-range_z, range_z+thres, thres)
46+
print('bins_x: ', bins_x)
47+
print('bins_z: ', bins_z)
48+
pts1 = pts1.cuda()
49+
pts2 = pts2.cuda()
50+
bins_x = bins_x.cuda()
51+
bins_y = bins_y.cuda()
52+
bins_z = bins_z.cuda()
53+
54+
t_hists = histf(pts1, pts2,
55+
-range_x, -range_y, -range_z,
56+
range_x, range_y, range_z,
57+
len(bins_x), len(bins_y), len(bins_z),
58+
)
59+
print('output shape: ', t_hists.shape)
60+
b, h, w, d = t_hists.shape
61+
for t_hist in t_hists:
62+
t_argmax = torch.argmax(t_hist)
63+
print(f't_argmax: {t_argmax}, {t_hist.max()} {h}, {w}, {d}, {t_argmax//d//w%h}, {t_argmax//d%w}, {t_argmax%d}')
64+
print('t_argmax', t_argmax//d//w%h, t_argmax//d%w, t_argmax%d, bins_x[t_argmax//d//w%h], bins_y[t_argmax//d%w], bins_z[t_argmax%d])
65+
66+
if __name__ == '__main__':
67+
68+
print("Pytorch version: ", torch.__version__)
69+
print("GPU version: ", torch.cuda.get_device_name())
70+
71+
run_test()

conf/model/fastnsf.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ target:
1313
early_patience: 10 # default is 10, set 30 to get better results
1414
point_cloud_range: [-51.2, -51.2, -3, 51.2, 51.2, 3]
1515

16-
val_monitor: val/Dynamic/Mean
1716
iter_only: True

conf/model/icpflow.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: icpflow
2+
3+
target:
4+
_target_: src.models.ICPFlow
5+
thres_dist: 0.1
6+
translation_frame: 1.67
7+
chunk_size: 50
8+
thres_iou: 0.2
9+
max_points: 10000
10+
min_cluster_size: 20
11+
thres_box: 0.1
12+
thres_rot: 0.1
13+
thres_error: 0.2
14+
speed: 1.67
15+
point_cloud_range: [-51.2, -51.2, -3, 51.2, 51.2, 3]
16+
17+
iter_only: True

conf/model/nsfp.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ target:
1111
early_patience: 30 # default is 30, set 100 to get better results (zeroflow setting.)
1212
point_cloud_range: [-51.2, -51.2, -3, 51.2, 51.2, 3]
1313

14-
val_monitor: val/Dynamic/Mean
1514
iter_only: True

0 commit comments

Comments
 (0)