Skip to content

Commit 29079fe

Browse files
committed
Merge branch 'main'
2 parents 508ee10 + 88f49bc commit 29079fe

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,22 @@ International Conference on Robotics and Automation (**ICRA**) 2025
4141
European Conference on Computer Vision (**ECCV**) 2024
4242
[ Strategy ] [ Self-Supervised ] - [ [arXiv](https://arxiv.org/abs/2407.01702) ] [ [Project](https://github.com/KTH-RPL/SeFlow) ] → [here](#seflow)
4343

44+
4445
- **DeFlow: Decoder of Scene Flow Network in Autonomous Driving**
4546
*Qingwen Zhang, Yi Yang, Heng Fang, Ruoyu Geng, Patric Jensfelt*
4647
International Conference on Robotics and Automation (**ICRA**) 2024
4748
[ Backbone ] [ Supervised ] - [ [arXiv](https://arxiv.org/abs/2401.16122) ] [ [Project](https://github.com/KTH-RPL/DeFlow) ] → [here](#deflow)
4849

4950
🎁 <b>One repository, All methods!</b>
50-
Additionally, *OpenSceneFlow* integrates following excellent works: [ICLR'24 ZeroFlow](https://arxiv.org/abs/2305.10424), [ICCV'23 FastNSF](https://arxiv.org/abs/2304.09121), [RA-L'21 FastFlow3D](https://arxiv.org/abs/2103.01306), [NeurIPS'21 NSFP](https://arxiv.org/abs/2111.01253). (More on the way...)
51+
Additionally, *OpenSceneFlow* integrates following excellent works: [ICLR'24 ZeroFlow](https://arxiv.org/abs/2305.10424), [CVPR'24 ICP-Flow](https://arxiv.org/abs/2402.17351), [ICCV'23 FastNSF](https://arxiv.org/abs/2304.09121), [RA-L'21 FastFlow3D](https://arxiv.org/abs/2103.01306), [NeurIPS'21 NSFP](https://arxiv.org/abs/2111.01253). (More on the way...)
5152

5253
<details> <summary> Summary of them:</summary>
5354

5455
- [x] [FastFlow3D](https://arxiv.org/abs/2103.01306): RA-L 2021, a basic backbone model.
5556
- [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).
5657
- [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.
57-
- [x] [FastNSF](https://arxiv.org/abs/2304.09121): ICCV 2023. SSL optimization-based.
58-
- [ ] [ICP-Flow](https://arxiv.org/abs/2402.17351): CVPR 2024. SSL optimization-based. Done coding, public after review.
58+
- [x] [FastNSF](https://arxiv.org/abs/2304.09121): ICCV 2023. SSL Optimization-based.
59+
- [x] [ICP-Flow](https://arxiv.org/abs/2402.17351): CVPR 2024. SSL Optimization-based.
5960
- [ ] [EulerFlow](https://arxiv.org/abs/2410.02031): ICLR 2025. SSL optimization-based. In my plan, haven't coding yet.
6061

6162
</details>
@@ -157,7 +158,7 @@ wget https://huggingface.co/kin-zhang/OpenSceneFlow/resolve/main/flow4d_best.ckp
157158

158159
#### SSF
159160

160-
Extra pakcges needed for SSF model:
161+
Extra packages needed for SSF model:
161162
```bash
162163
pip install mmengine-lite
163164
pip install torch-scatter -f https://data.pyg.org/whl/torch-2.0.0+cu117.html
@@ -235,6 +236,20 @@ python train.py model=deflowpp save_top_model=3 val_every=3 voxel_size="[0.2, 0.
235236
wget https://huggingface.co/kin-zhang/OpenSceneFlow/resolve/main/seflowpp_best.ckpt
236237
```
237238

239+
240+
### Optimization-based Unsupervised Methods
241+
242+
For all optimization-based methods, you can directly run `eval.py`/`save.py` to get the result without training, while the running might take really long time, maybe tmux for run it. For multi-program running, the master port can be set through `+master_port=12346`.
243+
244+
```bash
245+
# you can change another model by passing model name.
246+
python eval.py model=fastnsf
247+
248+
# or save the result directly
249+
python save.py model=fastnsf
250+
```
251+
252+
238253
## 3. Evaluation
239254

240255
You can view Wandb dashboard for the training and evaluation results or upload result to online leaderboard.

src/models/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@
4949
# * pip install pytorch3d assets/cuda/histlib
5050
try:
5151
from .icpflow import ICPFlow
52-
except ImportError:
52+
except ImportError as e:
5353
print("--- WARNING [model]: ICPFlow is not imported, as it requires pytorch3d lib which is not installed.")
5454
print(f"Detail error message\033[0m: {e}. Just ignore this warning if code runs without these models.")

src/runner.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,12 @@ def __init__(self, cfg, rank, world_size, mode):
101101
self.mode = mode
102102

103103
self.model.to(self.device)
104-
self.metrics = OfficialMetrics() if self.mode in ['val', 'eval'] else None
104+
self.metrics = OfficialMetrics() if self.mode in ['val', 'eval', 'valid'] else None
105+
self.res_name = cfg.get('res_name', cfg.model.name)
105106
self.save_res_path = cfg.get('save_res_path', None)
106107

107108
def _setup_dataloader(self):
108-
if self.mode in ['val', 'test', 'eval']:
109+
if self.mode in ['val', 'test', 'eval', 'valid']:
109110
dataset_path = self.cfg.dataset_path + f"/{self.cfg.data_mode}"
110111
is_eval_mode = True
111112
else: # 'save'
@@ -153,7 +154,7 @@ def _process_step(self, batch):
153154
final_flow = pose_flow.clone()
154155
final_flow[~batch['gm0']] = res_dict['flow'] + pose_flow[~batch['gm0']]
155156

156-
if self.mode in ['val', 'eval']:
157+
if self.mode in ['val', 'eval', 'valid']:
157158
eval_mask = batch['eval_mask'].squeeze()
158159
gt_flow = batch["flow"]
159160
v1_dict = evaluate_leaderboard(final_flow[eval_mask], pose_flow[eval_mask], pc0[eval_mask], \
@@ -257,7 +258,7 @@ def _run_process(cfg, mode):
257258
gathered_metrics_objects = [runner.metrics]
258259

259260
if rank == 0:
260-
if mode in ['val', 'eval']:
261+
if mode in ['val', 'eval', 'valid']:
261262
final_metrics = OfficialMetrics()
262263
print(f"\n--- [LOG] Finished processing. Aggregating results from {world_size} GPUs with {len(gathered_metrics_objects)} metrics objects...")
263264
for metrics_obj in gathered_metrics_objects:
@@ -301,8 +302,6 @@ def _run_process(cfg, mode):
301302

302303
def _spawn_wrapper(rank, world_size, cfg, mode):
303304
torch.cuda.set_device(rank)
304-
305-
# FIXME(Qingwen): better to set these through command, since we might have more nodes to connected.
306305
os.environ['RANK'] = str(rank)
307306
os.environ['WORLD_SIZE'] = str(world_size)
308307
os.environ['MASTER_ADDR'] = 'localhost'

0 commit comments

Comments
 (0)