norlab-ulaval / mask_bev

Source code for "MaskBEV: Joint Object Detection and Footprint Completion for Bird's-eye View 3D Point Clouds"
MIT License
16 stars 3 forks source link

About "Testing file" and Visualization #3

Open HaiCLi opened 1 month ago

HaiCLi commented 1 month ago

Hey,

Is there any commands of testing and visualization?

Thx!

HaiCLi commented 1 month ago

after "PYTHONPATH=. python3 mask_bev_test/evaluation/test_kitti_eval.py" "PYTHONPATH=. python3 mask_bev_figures/test_figures.py"

There is no any outputs.

willGuimont commented 1 month ago

Hi,

I've updated the scripts. The new procedure to run the tests is in docs/TESTING.md

PYTHONPATH=. python3.10 mask_bev_figures/test_figures.py
HaiCLi commented 1 week ago

Hi,

I've updated the scripts. The new procedure to run the tests is in docs/TESTING.md

PYTHONPATH=. python3.10 mask_bev_figures/test_figures.py

Hi,

Thanks for your reply! I encountered two areas that confused me. Could you help me with them?

1: Is the "datamoudle" automatically split the dataset already? I found all the "train, validation, test" areas use the same datamoudle as input. Besides, the validate and test commands are both under is_testing situation.

image

image

2: The augmentation part just use 10 samples for augemntation? image

Although this work is based on Swintransformer, it still a complex project. Thanks for your contribution.

willGuimont commented 6 days ago

Hi,

1. For your first question, yes, the datamodule automatically split the dataset. You can see the code in that does the split in mask_bev/datasets/kitti/kitti_data_module.py and mask_bev/datasets/semantic_kitti/semantic_kitti_mask_data_module.py. PyTorch Lightning allows you to write these three functions that define the dataset splits:

def train_dataloader(self):
    return DataLoader(self._train_dataset, batch_size=self._batch_size, num_workers=self._num_workers,
                      pin_memory=self._pin_memory, shuffle=self._shuffle_train, drop_last=True,
                      collate_fn=self._collate_fn)

def val_dataloader(self):
    return DataLoader(self._valid_dataset, batch_size=self._batch_size, num_workers=self._num_workers,
                      pin_memory=self._pin_memory, shuffle=False, drop_last=True, collate_fn=self._collate_fn)

def test_dataloader(self):
    return DataLoader(self._test_dataset, batch_size=self._batch_size, num_workers=self._num_workers,
                      pin_memory=self._pin_memory, shuffle=False, drop_last=False, collate_fn=self._collate_fn)

Afterwards, the trainer.fit, trainer.validate and trainer.test function will take the corresponding DataLoader for each training phase.

For KITTI, the splits are defined using train.txt and val.txt in the dataset. For SemanticKITTI, the splits are defined in configs/semantic_kitti/semantic-kitti.yaml.

2. For your second question, the object sampler will add up to 10 cars from KITTI to a point cloud as data augmentation. In other words, it will take instances from KITTI and paste them inside the point clouds during training to augment the number of instances per scan. It won't overlap with existing instances in a scan, so it can only add cars to a particular LiDAR scan.

The code applying that augmentation can be found in mask_bev/augmentations/kitti_mask_augmentations.py. The function make_augmentation does the mapping between the names in the yaml file and the augmentation classes.

Hope it helps!