Skip to content
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

Introduce random drop box 3D data augmentation. #1084

Merged
merged 67 commits into from
Dec 5, 2022

Conversation

lengzq
Copy link
Collaborator

@lengzq lengzq commented Dec 3, 2022

What does this PR do?

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue? Please add a link
    to it if that's the case.
  • Did you write any new necessary tests?
  • If this adds a new model, can you run a few training steps on TPU in Colab to ensure that no XLA incompatible OP are used?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@lengzq
Copy link
Collaborator Author

lengzq commented Dec 3, 2022

@tanzhenyu

Copy link
Contributor

@tanzhenyu tanzhenyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!
Some minor comments


def __init__(self, label_index=None, max_drop_bounding_boxes=10, **kwargs):
super().__init__(**kwargs)
self.auto_vectorize = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe we should just make auto_vectorize by default False for the moment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

label_index: An optional int scalar sets the target object index.
If label index is set, randomly drop bounding boxes, where box class == label_index.
If label index is None, randomly drop bounding boxes, where box class > 0.
max_drop_bounding_boxes: A int scalar sets the maximum number of dropped bounding boxes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a int non negative scalar

Also default what =0 means here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


"""

def __init__(self, label_index=None, max_drop_bounding_boxes=10, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is 10 a good default number, or do we make this argument mandatory?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change it to mandatory.

@lengzq lengzq requested a review from tanzhenyu December 5, 2022 20:56
@tanzhenyu
Copy link
Contributor

/gcbrun

@tanzhenyu tanzhenyu merged commit 41c8661 into keras-team:master Dec 5, 2022
ghost pushed a commit to y-vectorfield/keras-cv that referenced this pull request Nov 16, 2023
* Add base augmentation layer for 3D preception.

* Fix format.

* Add copyright.

* Minor change.

* revert the minor change in the test file.

* 1. Add global_z_rotation data augmentation.
2. Add wrap_angle_rad helper function.

* Auto format.

* 1. Standardize POINT_CLOUDS and BOUNDING_BOXES
2. Change rads -> radians
3. Good point. We could add X or Y rotation as future work. For this PR, let's check in Z rotation first.

* Format.

* Delete base_augmentation_layer_3d.py

* Delete base_augmentation_layer_3d_test.py

* Standardize POINT_CLOUDS and BOUNDING_BOXES names.

* Change GlobalZRotation to GlobalRandomZRotation

* Support rotation along X, Y and Z axes.

* format.

* Change file name from global_rotation to global_random_rotation.

* Add four more global data augmentations for 3d.

* format.

* Remove unused import.

* Fix a typo in GlobalRandomFlippingY.

* Support scaling x, y, and z.

* Format.

* update random scaling.

* Modified based on comments.

* follow up.

* Fix a typo in random_scaling_test.py

* Update.

* Fix two typos.

* Crop object.

* Remove tf.print in test.

* Fix typos.

* test failed when using is_within_box3d + map function

* update.

* Rename to group_points_by_bounding_boxes.

* Update.

* Update.

* Format.

* Format.

* Fix a typo.

* Update.

* fix a typo.

* Introducing randomly pasting object data augmentation.

* Update.

* Update.

* update.

* Update.

* Update.

* Update.

* Swap background data augmentation.

* Update.

* Update.

* Clean up.

* Update.

* Update

* Random drop box augmentation.

* Update.

* Update.

Co-authored-by: Leng Zhaoqi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants