-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Implement AutoAugment for Detection #6609
base: main
Are you sure you want to change the base?
Implement AutoAugment for Detection #6609
Conversation
|
@ain-soph thanks for the PR, let's remove useless files:
|
Oops! Sorry for missing that... I'll change it soon. |
@ain-soph do you have any working testing code to run it and visually check the output ? If yes, please share it here, it would be helpful. Thanks ! |
@vfdev-5 Sorry for the latency. Was busy at ICLR for the past week. I'll add some test codes tmr. |
The recent auto-augment api modification forces me to re-design the api for detection. I'm still working on this now. Need to know how the new framework works. |
@ain-soph The API should be more stable now. Which specific AA modification broke your code. Perhaps we can help you? |
@datumbox Sorry for dragging it so long. The main confusing part is how I can extract the bounding box from inputs, and (after augmentation) how I can insert the modified bounding box back to inputs. Current image classification codes don't have this part and I can't find something for reference. |
@ain-soph Apologies for the rough edges. You are basically brave for digging into the developer part of the API so early. The public part should be fairly stable. We will continue polishing the internal part to make the experience smoother. The method you probably want for extracting the bounding boxes is @vfdev-5 / @pmeier any recommendation on your side at this point? |
I've uploaded a version that shall work and make a very simple unittest. Please take a review and I'm expecting some guidance to improve, thanks! There are still a few to-do items on the plate, especially some augment operations not implemented in current transforms library yet: |
@vfdev-5 This PR shall be ready for merge and please take a final review. I have annotated some detailed comments in codes. Summary:
Several small concerns remaining:
|
@vfdev-5 @datumbox Any feedback from maintainers? I think all code work has been finished and this PR is already ready for review. Please refer to #6609 (comment) for a work summary. |
@ain-soph thanks for pinging and sorry for the delay, I'll check the code this week and see how we can make it done finally |
OK, let's remove
Commented in the code. Let's remove all AADet related stuff from AABase.
This is probably ok.
Seems like ok. @ain-soph thanks for the work on this transformation! It is rather untrivial and especially that we need finally to train a model with this transform to see real benefit of using it. Let's fix reported bugs and merge it and continue with follow-up PRs. |
…results Added another smoke test
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.
LGTM, thanks a lot for the PR @ain-soph and appologies for such long review.
I pushed main class AutoAugmentDetection as _AutoAugmentDetection
temporarily the time we validate everything and write proper non-regression tests.
I'll comment in this PR on the next steps.
@@ -621,3 +678,309 @@ def forward(self, *inputs: Any) -> Any: | |||
mix = F.to_image_pil(mix) | |||
|
|||
return self._unflatten_and_insert_image_or_video(flat_inputs_with_spec, mix) | |||
|
|||
|
|||
class _AutoAugmentDetectionBase(_AutoAugmentBase): |
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.
What's the reason for having _AutoAugmentDetectionBase
? It seems to only be used by one child class
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.
Later we could simply add other AA techniques for detection.
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.
do we plan to?
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.
There is no clear plans at the moment. Do you want to simplify that and readd later ?
@vfdev-5 @NicolasHug Feel free to ping me when there is a plan from maintainers for following work. I could continue working on this. |
Implement #6224.
Implement Learning Data Augmentation Strategies for Object Detection
Refers to: #3817
Motivation, pitch
Good to have augmentation in Torchvision
cc @vfdev-5 @datumbox