Skip to content

Commit 4d4eecd

Browse files
committed
update the script to convert old weight to new version.
write4conf.py file, todo update model weights later.
1 parent 1d0d26d commit 4d4eecd

12 files changed

Lines changed: 46 additions & 30 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ python save.py checkpoint=/home/kin/seflow_best.ckpt dataset_path=/home/kin/data
159159
# The output of above command will be like:
160160
Model: DeFlow, Checkpoint from: /home/kin/model_zoo/v2/seflow_best.ckpt
161161
We already write the flow_est into the dataset, please run following commend to visualize the flow. Copy and paste it to your terminal:
162-
python tools/scene_flow.py --flow_mode 'seflow_best' --data_dir /home/kin/data/av2/preprocess_v2/sensor/vis
162+
python tools/visualization.py --res_name 'seflow_best' --data_dir /home/kin/data/av2/preprocess_v2/sensor/vis
163163
Enjoy! ^v^ ------
164164

165165
# Then run the command in the terminal:
166-
python tools/scene_flow.py --flow_mode 'seflow_best' --data_dir /home/kin/data/av2/preprocess_v2/sensor/vis
166+
python tools/visualization.py --res_name 'seflow_best' --data_dir /home/kin/data/av2/preprocess_v2/sensor/vis
167167
```
168168

169169
https://github.com/user-attachments/assets/f031d1a2-2d2f-4947-a01f-834ed1c146e6

conf/model/deflow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: deflow
22

33
target:
4-
_target_: src.models.deflow.DeFlow
4+
_target_: src.models.DeFlow
55
decoder_option: gru # choices: [linear, gru]
66
num_iters: 4
77
voxel_size: ${voxel_size}

conf/model/fastflow3d.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: fastflow3d
22

33
target:
4-
_target_: src.models.fastflow3d.FastFlow3D
4+
_target_: src.models.FastFlow3D
55
voxel_size: ${voxel_size}
66
point_cloud_range: ${point_cloud_range}
77

conf/vis.yaml renamed to conf/save.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dataset_path: /home/kin/data/av2/preprocess_v2/sensor/vis
1+
dataset_path: /home/kin/data/av2/preprocess_v2/demo/sensor/val
22
checkpoint: /home/kin/model_zoo/seflow_best.ckpt
33
res_name: # if None will directly be the `model_name.ckpt` in checkpoint path
44

dataprocess/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Or you can run testing file to visualize the data.
140140

141141
```bash
142142
# view gt flow
143-
python3 tools/scene_flow.py --data_dir /home/kin/data/av2/preprocess/sensor/mini --flow_mode flow
143+
python tools/visualization.py --data_dir /home/kin/data/av2/preprocess/sensor/mini --res_name flow
144144

145-
python3 tools/scene_flow.py --data_dir /home/kin/data/waymo/preprocess/val --flow_mode flow
145+
python tools/visualization.py --data_dir /home/kin/data/waymo/preprocess/val --res_name flow
146146
```

save.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from src.trainer import ModelWrapper
2323
from src.utils import bc
2424

25-
@hydra.main(version_base=None, config_path="conf", config_name="vis")
25+
@hydra.main(version_base=None, config_path="conf", config_name="save")
2626
def main(cfg):
2727
pl.seed_everything(cfg.seed, workers=True)
2828
output_dir = HydraConfig.get().runtime.output_dir

src/dataset.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,6 @@ def __getitem__(self, index_):
149149
pc1 = torch.tensor(f[next_timestamp]['lidar'][:][:,:3])
150150
gm1 = torch.tensor(f[next_timestamp]['ground_mask'][:])
151151
pose1 = torch.tensor(f[next_timestamp]['pose'][:])
152-
# if pc0[~gm0].shape[0] == 0:
153-
# print(f"\nWarning: empty point cloud! scene_id: [{scene_id}, {timestamp}], Check the data!\n")
154-
# return self.__getitem__(index_+1)
155-
# elif pc1[~gm1].shape[0] == 0:
156-
# print(f"\nWarning: empty point cloud! scene_id: [{scene_id}, {next_timestamp}], Check the data!\n")
157-
# return self.__getitem__(index_-1)
158152
res_dict = {
159153
'scene_id': scene_id,
160154
'timestamp': key,

src/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from .deflow import DeFlow
2+
from .fastflow3d import FastFlow3D

src/trainer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def on_validation_epoch_end(self):
214214

215215
if self.save_res:
216216
print(f"We already write the flow_est into the dataset, please run following commend to visualize the flow. Copy and paste it to your terminal:")
217-
print(f"python tools/scene_flow.py --flow_mode '{self.vis_name}' --data_dir {self.dataset_path}")
217+
print(f"python tools/visualization.py --res_name '{self.vis_name}' --data_dir {self.dataset_path}")
218218
print(f"Enjoy! ^v^ ------ \n")
219219

220220
def eval_only_step_(self, batch, res_dict):
@@ -310,5 +310,5 @@ def on_test_epoch_end(self):
310310
self.model.timer.print(random_colors=False, bold=False)
311311
print(f"\n\nModel: {self.model.__class__.__name__}, Checkpoint from: {self.load_checkpoint_path}")
312312
print(f"We already write the flow_est into the dataset, please run following commend to visualize the flow. Copy and paste it to your terminal:")
313-
print(f"python tools/scene_flow.py --flow_mode '{self.vis_name}' --data_dir {self.dataset_path}")
313+
print(f"python tools/visualization.py --res_name '{self.vis_name}' --data_dir {self.dataset_path}")
314314
print(f"Enjoy! ^v^ ------ \n")

tools/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ run `tools/scene_flow.py` to view the scene flow dataset with ground truth flow.
1212

1313
```bash
1414
# view gt flow
15-
python3 tools/scene_flow.py --data_dir /home/kin/data/av2/preprocess/sensor/mini --flow_mode flow
15+
python3 tools/scene_flow.py --data_dir /home/kin/data/av2/preprocess/sensor/mini --res_name flow
1616

1717
# view est flow
18-
python3 tools/scene_flow.py --data_dir /home/kin/data/av2/preprocess/sensor/mini --flow_mode deflow_best
19-
python3 tools/scene_flow.py --data_dir /home/kin/data/av2/preprocess/sensor/mini --flow_mode seflow_best
18+
python3 tools/scene_flow.py --data_dir /home/kin/data/av2/preprocess/sensor/mini --res_name deflow_best
19+
python3 tools/scene_flow.py --data_dir /home/kin/data/av2/preprocess/sensor/mini --res_name seflow_best
2020
```
2121

2222
Demo Effect (press `SPACE` to stop and start in the visualization window):

0 commit comments

Comments
 (0)