-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new augmentation methods and the option of augmentation by addition instead of replacement #653
Conversation
I've kept only the essential code to perform the augmentations, which is written in the files: data_augmentor.py and augmentor_utils.py. The visualization of the effect of these augmentations can be done through the jupyter notebook in my fork of the repository. I've also included a config file for PointPillars, which successfully replicates the results of the augmentation policy proposed by Hahner et al. in https://arxiv.org/abs/2004.01643 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the clear codes!
Have you already checked the augmented results by visualization?
What's the performance comparison between with and without these augmentations?
return gt_boxes, points | ||
|
||
def get_points_in_box(points, gt_box): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this right?
Since you do not consider the orientation of gt_box, so simply checking the points with (xyz, dxdydz) may return wrong points.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The results were visually validated using this tool: https://github.com/xaviersantos/OpenPCDet/blob/dev/data_augmentation.ipynb
Here are some images taken from these augmentations (the magnitude of the transformations was exaggerated for better visualization):
Comparing the results of the new augmentation methods with the ones already implemented, these were the improvements:
These models models were trained for 80 epochs keeping all the same default hyperparameters.
As for the orientation of the gt_boxes, it should have no influence on the selection of the points inside its bounds (function get_points_in_box), as the center of the box and its dimensions are enough to the describe all the points within the box.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The performance looks good!
But I still do not understand why you do not need to consider the orientation.
Simply checking the center+dimensions of boxes for selecting inside points should only work for boxes with heading_angle=0.
What would happen when you conduct this function for a gt_box with heading_angle=pi/4? I think the inside points could not be well selected by this function since the gt_box is oblique.
Actually I have implemented a function to select inside points from a rotated box (https://github.com/open-mmlab/OpenPCDet/blob/master/pcdet/ops/roiaware_pool3d/src/roiaware_pool3d.cpp#L121-L140), could you comment on the difference between your function and my function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean and you're right.
I've fixed the get_points_in_box function using a numpy logical mask based on your code, as well as the local frustum dropout functions which had the same mistake.
The results were validated visually in scenes with objects in oblique positions and everything seems to be working as intended. I couldn't, however, train a model with this new fix to see if there are further improvements in performance yet, because the workstation I've been using for training is currently unavailable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thank you!
I will try to train with your config and get back to here soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xaviersantos I find a function points_in_boxes_cpu
implemented in ./pcdet/ops/roiaware_pool3d/roiaware_pool3d_utils.py
similar with your vesion get_points_in_box
. I would like to know why you don't use it.
Hi, I have trained and tested two configs (w./w.o new aug) of pointpillar. Sorry I am a little bit busy and do not have much time to look into it.
|
I also do not have time to look into it further at the moment. |
I've noticed a couple of bugs in the cfg file I've provided. That may have something to do with the performance drop, as two unwanted transformations were being applied and one intended transformation wasn't. I'm sorry I cannot test the results before committing, but the workstation I was using for training is facing some technical difficulties and won't be available for the next couple of weeks. |
@sshaoshuai: can you repeat the training with the updated "newaugs" config? |
Sure, the experiment has been repeated. Let's see what will happen after fixing the bug. |
Here are the new results, and we still do not see obvious performance improvement with the new augs.
|
From our paper:
The updated "newaugs" config from @xaviersantos should correspond to the strongest augmentation policy we found in our paper. I have double-checked it, but I have not checked the code. @sshaoshuai: If you don't mind, you could run each experiment two more times and report the strongest run of all three, then it would be in accordance with what we did in our study. |
@MartinHahner @xaviersantos , thank you for the comments and visualizations, I will launch a second run for them. I may merge these new augs if they achieve similar performance, since the effectiveness of new augs may depends on the dataset and the experiments on KITTI may not be stable. Maybe we can just merge these new augs for potential future usage and leave the problems to the researchers who will use it on their own datasets. |
The results of second runs (each with 4gpus, and the above results are trained with 8gpus):
|
@sshaoshuai, I totally agree. Seeing as each augmentation is toggleable through the config file and does not affect the rest of the code, I think it could be useful to researchers to have these tools available. As long as each transformation does what is intended of them, should be a helpful addition. The performance gains are relative to the dataset and the model's hyperparameters so there may be some trial and error in trying to come up with a new configuration which includes these augmentations. I've increased the margin in the selection of points to be transformed, because, at least visually, it seemed to produce better results. Let me know if you agree. |
… warning to check the correctness before using
Hi, Feel free to submit a new PR if you want to do any modifications. |
Hi, awesome work. I am impressed to see your work on Lidar Augmentation. I have a few questions for you: |
Hi @xaviersantos ! We would also like to invite you to join our Special Interest Group (SIG) private channel on Discord, where you can share your experiences, ideas, and build connections with like-minded peers. To join the SIG channel, simply message moderator— OpenMMLab on Discord or briefly share your open-source contributions in the #introductions channel and we will assist you. Look forward to seeing you there! Join us :https://discord.gg/UjgXkPWNqA If you have WeChat account,welcome to join our community on WeChat. You can add our assistant :openmmlabwx. Please add "mmsig + Github ID" as a remark when adding friends:) |
Greetings,
The new augmentation methods I've implemented follow the same logic as the already implemented ones through the yaml files and are the following:
Furthermore, a new method of augmenting by adding X fold augmented samples instead of replacing the original ones through the following fields in the DATA_AUGMENTATION section of the yaml file:
Feel free to use and modify whatever you need.
Best regards,
Xavier Santos