Skip to content

Commit c5f5746

Browse files
Add MAN TruckScenes data processing into codebase (#19)
* docs(truckscene): starting update truckscene dataprocess. * feat(truckscene): debug-mode for the file, will clean it up. * feat(truckscenes): finished the version and test successfully. * !hotfix(pose): the pose save type must be float64! do not astype 32 before you finished the ego_motion compute. * docs(README): update readme and slurm process script for users . --------- Co-authored-by: ajinkyakhoche <ajinkyakhoche@users.noreply.github.com>
1 parent 9c38bcc commit c5f5746

File tree

19 files changed

+637
-95
lines changed

19 files changed

+637
-95
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ build*
2828
dist*
2929

3030
data
31+
*.pcd
3132
*__pycache__

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ It is also an official implementation of the following papers (sorted by the tim
1313

1414
- **DeltaFlow: An Efficient Multi-frame Scene Flow Estimation Method**
1515
*Qingwen Zhang, Xiaomeng Zhu, Yushan Zhang, Yixi Cai, Olov Andersson, Patric Jensfelt*
16-
Preprint; Under review; 2025
16+
Conference on Neural Information Processing Systems (**NeurIPS**) 2025 - Spotlight
1717
[ Backbone ] [ Supervised ] - [ [arXiv](https://arxiv.org/abs/2508.17054) ] [ [Project](https://github.com/Kin-Zhang/DeltaFlow) ]
1818

1919
- **HiMo: High-Speed Objects Motion Compensation in Point Clouds** (SeFlow++)
@@ -102,7 +102,7 @@ If you prefer to build the Docker image by yourself, Check [build-docker-image](
102102

103103
## 1. Data Preparation
104104

105-
Refer to [dataprocess/README.md](dataprocess/README.md) for dataset download instructions. Currently, we support **Argoverse 2**, **Waymo**, **nuScenes**, **ZOD** and **custom datasets** (more datasets will be added in the future).
105+
Refer to [dataprocess/README.md](dataprocess/README.md) for dataset download instructions. Currently, we support **Argoverse 2**, **Waymo**, **nuScenes**, [**MAN-TruckScene**](https://github.com/TUMFTM/truckscenes-devkit), [**ZOD**](https://github.com/zenseact/zod) and **custom datasets** (more datasets will be added in the future).
106106

107107
After downloading, convert the raw data to `.h5` format for easy training, evaluation, and visualization. Follow the steps in [dataprocess/README.md#process](dataprocess/README.md#process).
108108

@@ -337,6 +337,12 @@ If you find it useful, please cite our works:
337337
year={2025},
338338
journal={arXiv preprint arXiv:2503.00803},
339339
}
340+
@article{zhang2025deltaflow,
341+
title={{DeltaFlow}: An Efficient Multi-frame Scene Flow Estimation Method},
342+
author={Zhang, Qingwen and Zhu, Xiaomeng and Zhang, Yushan and Cai, Yixi and Andersson, Olov and Jensfelt, Patric},
343+
year={2025},
344+
journal={arXiv preprint arXiv:2508.17054},
345+
}
340346
```
341347

342348
And our excellent collaborators works contributed to this codebase also:

assets/slurm/0_process.sh

Lines changed: 0 additions & 37 deletions
This file was deleted.

assets/slurm/data-process.sh

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
#SBATCH -J dataprocess
3+
#SBATCH -p berzelius-cpu
4+
#SBATCH --cpus-per-task 64
5+
#SBATCH --mem 128G
6+
#SBATCH --mincpus=64
7+
#SBATCH -t 2-00:00:00
8+
#SBATCH --mail-type=END,FAIL
9+
#SBATCH --mail-user=qingwen@kth.se
10+
#SBATCH --output /proj/berzelius-2023-154/users/x_qinzh/OpenSceneFlow/logs/slurm/%J_data.out
11+
#SBATCH --error /proj/berzelius-2023-154/users/x_qinzh/OpenSceneFlow/logs/slurm/%J_data.err
12+
13+
PYTHON=/proj/berzelius-2023-154/users/x_qinzh/mambaforge/envs/sftool/bin/python
14+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/proj/berzelius-2023-154/users/x_qinzh/mambaforge/lib
15+
cd /proj/berzelius-2023-154/users/x_qinzh/OpenSceneFlow/
16+
# export HYDRA_FULL_ERROR=1
17+
18+
19+
# =============== Argoverse2
20+
# $PYTHON dataprocess/extract_av2.py --nproc 64 \
21+
# --av2_type sensor \
22+
# --data_mode train \
23+
# --argo_dir /proj/berzelius-2023-154/users/x_qinzh/av2 \
24+
# --output_dir /proj/berzelius-2023-364/users/x_qinzh/data/av2/h5py
25+
26+
# $PYTHON dataprocess/extract_av2.py --nproc 64 \
27+
# --av2_type sensor \
28+
# --data_mode val \
29+
# --argo_dir /proj/berzelius-2023-154/users/x_qinzh/av2 \
30+
# --output_dir /proj/berzelius-2023-364/users/x_qinzh/data/av2/h5py \
31+
# --mask_dir /proj/berzelius-2023-154/users/x_qinzh/av2/3d_scene_flow
32+
33+
# $PYTHON dataprocess/extract_av2.py --nproc 64 \
34+
# --av2_type sensor \
35+
# --data_mode test \
36+
# --argo_dir /proj/berzelius-2023-154/users/x_qinzh/av2 \
37+
# --output_dir /proj/berzelius-2023-364/users/x_qinzh/data/av2/h5py \
38+
# --mask_dir /proj/berzelius-2023-154/users/x_qinzh/av2/3d_scene_flow
39+
40+
# =============== Waymo Open Dataset
41+
# $PYTHON dataprocess/extract_waymo.py --nproc 12 \
42+
# --map_dir /proj/berzelius-2023-154/users/x_qinzh/dataset/waymo/flowlabel/map \
43+
# --flow_data_dir /proj/berzelius-2023-154/users/x_qinzh/dataset/waymo/flowlabel \
44+
# --output_dir /proj/berzelius-2023-154/users/x_qinzh/dataset/waymo/h5py \
45+
# --mode train
46+
47+
$PYTHON dataprocess/extract_waymo.py --nproc 12 \
48+
--map_dir /proj/berzelius-2023-154/users/x_qinzh/dataset/waymo/flowlabel/map \
49+
--flow_data_dir /proj/berzelius-2023-154/users/x_qinzh/dataset/waymo/flowlabel \
50+
--output_dir /proj/berzelius-2023-154/users/x_qinzh/dataset/waymo/h5py \
51+
--mode valid
52+
53+
# =============== MAN-Truckscenes
54+
# $PYTHON dataprocess/extract_truckscenes.py --nproc 12 \
55+
# --data_dir /proj/common-datasets/MAN-TruckScenes/v1.0 \
56+
# --mode v1.0-trainval \
57+
# --output_dir /proj/berzelius-2023-364/data/truckscenes/h5py \
58+
# --split_name val
59+
60+
# $PYTHON dataprocess/extract_truckscenes.py --nproc 12 \
61+
# --data_dir /proj/common-datasets/MAN-TruckScenes/v1.0 \
62+
# --mode v1.0-trainval \
63+
# --output_dir /proj/berzelius-2023-364/data/truckscenes/h5py \
64+
# --split_name train

assets/slurm/ssl-process.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
#SBATCH -J ssl-label
3+
#SBATCH -p berzelius-cpu
4+
#SBATCH --cpus-per-task 64
5+
#SBATCH --mem 128G
6+
#SBATCH --mincpus=64
7+
#SBATCH -t 2-00:00:00
8+
#SBATCH --array=0-5
9+
#SBATCH --mail-type=END,FAIL
10+
#SBATCH --mail-user=qingwen@kth.se
11+
#SBATCH --output /proj/berzelius-2023-154/users/x_qinzh/OpenSceneFlow/logs/slurm/data/%A-%a.out
12+
#SBATCH --error /proj/berzelius-2023-154/users/x_qinzh/OpenSceneFlow/logs/slurm/data/%A-%a.err
13+
14+
15+
PYTHON=/proj/berzelius-2023-154/users/x_qinzh/mambaforge/envs/sftool/bin/python
16+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/proj/berzelius-2023-154/users/x_qinzh/mambaforge/lib
17+
cd /proj/berzelius-2023-154/users/x_qinzh/OpenSceneFlow
18+
19+
20+
# data directory containing the extracted h5py files
21+
DATA_DIR="/proj/berzelius-2023-364/data/truckscenes/h5py/val"
22+
23+
TOTAL_SCENES=$(ls ${DATA_DIR}/*.h5 | wc -l)
24+
# Process every n-th frame into DUFOMap, no need to change at least for now.
25+
INTERVAL=1
26+
NUM_TOTAL_ITEMS=$((TOTAL_SCENES + 1))
27+
SPLIT_SIZE=$(( (NUM_TOTAL_ITEMS + SLURM_ARRAY_TASK_COUNT - 1) / SLURM_ARRAY_TASK_COUNT ))
28+
echo "===================================================="
29+
echo "Job ID: ${SLURM_JOB_ID}, Array Task ID: ${SLURM_ARRAY_TASK_ID}"
30+
echo "Total jobs in array: ${SLURM_ARRAY_TASK_COUNT}"
31+
echo "Total scenes to process: $((TOTAL_SCENES + 1)) (from 0 to ${TOTAL_SCENES})"
32+
33+
# --- Task Logic ---
34+
# SLURM_ARRAY_TASK_ID is the index of the current job in the array (e.g., 0, 1, 2,...)
35+
START_SCENE=$((SLURM_ARRAY_TASK_ID * SPLIT_SIZE))
36+
37+
END_SCENE=$((START_SCENE + SPLIT_SIZE))
38+
if [ $END_SCENE -gt $((TOTAL_SCENES + 1)) ]; then
39+
END_SCENE=$((TOTAL_SCENES + 1))
40+
fi
41+
42+
echo "Running job for task id ${SLURM_ARRAY_TASK_ID}"
43+
echo "Processing scene range: ${START_SCENE} to ${END_SCENE}"
44+
$PYTHON process.py --data_dir ${DATA_DIR} --interval ${INTERVAL} --scene_range ${START_SCENE},${END_SCENE}

assets/tests/hdbscan_speed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
def vis(pc0, labels, title='HDBSCAN'):
2727
# visualize
28-
vis = MyVisualizer(view_file=f'{BASEF_DIR}/assets/view/av2.json', window_title=title)
28+
vis = MyVisualizer(view_file=f'{BASEF_DIR}/assets/view/demo.json', window_title=title)
2929
pcd = o3d.geometry.PointCloud()
3030
num_points = pc0.shape[0]
3131
pcd.points = o3d.utility.Vector3dVector(pc0)

assets/view/av2.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

assets/view/demo.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"class_name" : "ViewTrajectory",
3+
"interval" : 29,
4+
"is_loop" : false,
5+
"trajectory" :
6+
[
7+
{
8+
"boundingbox_max" : [ 215.05035400390625, 80.301795959472656, 34.890830993652344 ],
9+
"boundingbox_min" : [ -211.76950073242188, -125.19444274902344, -4.2829980850219727 ],
10+
"field_of_view" : 90.0,
11+
"front" : [ -0.58999680455306347, -0.15524870408634167, 0.79233932787454509 ],
12+
"lookat" : [ 9.9369846496341676, 13.322769196068615, -16.164870152242376 ],
13+
"up" : [ 0.79499677526385637, 0.059685607254847638, 0.60367023746967163 ],
14+
"zoom" : 0.17999999999999999
15+
}
16+
],
17+
"version_major" : 1,
18+
"version_minor" : 0
19+
}

conf/others/truckscenes.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
[important]
3+
height = 0 # ego height. since truckscene have multiple LiDARs, we set pc to ego-coord already.
4+
5+
# 整个雷点点云以自己为中心 分为多少个segment,每个segment又分成多少个bin
6+
[segments]
7+
r_min = 0.1 # minimum point distance. 感兴趣的区域
8+
r_max = 100 # maximum point distance.
9+
n_segments = 360 # number of radial segments.
10+
n_bins = 160 # number of radial bins.
11+
12+
13+
[ground]
14+
# 直线的 slope 斜率,一个seg里拟合的线斜率
15+
min_slope = 0.0 # minimum slope of a ground line. [T_m_small]
16+
max_slope = 0.1 # maximum slope of a ground line. [T_m]
17+
# 如果拟合点超过这个 long threshold,判断其 height 变化是否超过 max_long_height
18+
long_threshold = 2.0 # Distance at which points are considered far from each other. [T_d_prev]
19+
max_long_height = 0.3 # maximum height change to previous point in long line. [T_b]
20+
# 如果没有超过 long threshold,判断现在拟合的点与fitline高度变化是否超过 max_start_height
21+
max_start_height = 0.2 # Maximum heigh of starting line to be labelled ground.
22+
# 最大的拟合误差,超过这个误差的点不会被加入 line 拟合
23+
max_fit_error = 0.1 # maximum error of a point during line fit. [T_RMSE: will sqaure inside code.]
24+
25+
# 判断是否是地面点的时候,需要满足的条件:
26+
max_dist_to_line = 0.2 # maximum vertical distance of point to line to be considered ground. [T_d_ground]
27+
line_search_angle = 2.0 # How far to search for a line in angular direction [rad].
28+
29+
[general]
30+
n_threads = 8 # number of threads for parallel processing.
31+
verbose = false # if you don't want to see every output, set this to false.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ max_start_height = 0.2 # Maximum heigh of starting line to be labelled ground.
2323
max_fit_error = 0.1 # maximum error of a point during line fit. [T_RMSE: will sqaure inside code.]
2424

2525
# 判断是否是地面点的时候,需要满足的条件:
26-
max_dist_to_line = 0.2 # maximum vertical distance of point to line to be considered ground. [T_d_ground]
26+
max_dist_to_line = 0.25 # maximum vertical distance of point to line to be considered ground. [T_d_ground]
2727
line_search_angle = 2.0 # How far to search for a line in angular direction [rad].
2828

2929
[general]

0 commit comments

Comments
 (0)